Number Base Converter
Convert numbers between decimal, binary, octal, and hexadecimal bases instantly.
Digits 0–9
Digits 0–1
Digits 0–7
Digits 0–9, A–F
Convert between binary, octal, decimal and hex
This number base converter shows one whole number in four bases at once: decimal (base 10), binary (base 2), octal (base 8) and hexadecimal (base 16). Type in any of the four boxes and the other three update straight away. It works as a hex to decimal converter, a decimal to binary converter or any other pair.
How to use it
- Type a number into the Decimal, Binary, Octal or Hexadecimal box.
- Read the converted values in the other three boxes.
- Use the Bit Representation panel to see the binary value padded to 8, 16 or 32 bits, grouped in fours.
- Click Copy above any box to copy that value.
How base conversion works
Each digit is multiplied by the base raised to the power of its position, counting from 0 on the right. Hex digits A to F stand for 10 to 15.
Example, hex to decimal: FF = 15 × 16 + 15 × 1 = 255.
The same value in the other bases:
| Base | Value |
|---|---|
| Decimal | 255 |
| Binary | 11111111 |
| Octal | 377 |
| Hexadecimal | FF |
| 8-bit view | 1111 1111 |
Input rules and limits
- Only valid digits are accepted: 0–1 for binary, 0–7 for octal, 0–9 for decimal and 0–9 or A–F for hex (upper or lower case). Anything else shows an error under the box.
- Prefixes such as
0xor0bare not accepted. Type the digits only. - Only whole, non-negative numbers are supported. There is no fraction or two's complement mode.
- Hex output is shown in upper case.
- Numbers above 9,007,199,254,740,991 (2 to the power of 53, minus 1) may lose precision because the tool uses standard JavaScript numbers.
- The bit panel goes up to 32 bits. Larger values still convert, but the bit view asks for a wider size.
Frequently asked questions
How do I convert hex to decimal?
Type the hex value, such as 7E8, into the Hexadecimal box. The Decimal box shows 2024.
Why are some bit sizes greyed out?
A bit size is disabled when the number needs more bits than that size holds. For example, 256 needs 9 bits, so 8-bit is unavailable.
Related Text Tools
Browse all tools from the same category.
Word Counter
Words, characters, sentences, and paragraphs
Open toolText Case Converter
Upper, lower, title, and sentence case
Open toolShowing 1-2 of 27