🔢

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

About this tool

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

  1. Type a number into the Decimal, Binary, Octal or Hexadecimal box.
  2. Read the converted values in the other three boxes.
  3. Use the Bit Representation panel to see the binary value padded to 8, 16 or 32 bits, grouped in fours.
  4. 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:

BaseValue
Decimal255
Binary11111111
Octal377
HexadecimalFF
8-bit view1111 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 0x or 0b are 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.

More to explore

Related Text Tools

Browse all tools from the same category.

Showing 1-2 of 27