Skip to content

Number Base Converter - Binary, Octal, Decimal, Hex

All bases
Binary (2)—
Octal (8)—
Decimal (10)—
Hexadecimal (16)—
Base 36—

Convert Between Any Number Bases

Type a number, choose the base it is written in, and the converter shows it in binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) at once, plus one custom base you pick from 2 to 36. Results update as you type and each one has its own copy button.

Values are held as arbitrary-precision integers, so large IDs, 64-bit masks and cryptographic numbers convert without rounding. Need one direction only? There are focused pages for binary to decimal, decimal to binary, hex to decimal and decimal to hex.

How Positional Number Systems Work

In any base b, each digit is multiplied by a power of b that depends on its position, counting from 0 on the right. The decimal number 347 means 3 × 10² + 4 × 10¹ + 7 × 10⁰. The same rule applies in every base; only the multiplier changes. To convert into a base, you go the other way: divide by the base repeatedly and collect the remainders.

Worked Example: 2024 in Five Bases

  • Hex: 2024 ÷ 16 = 126 r 8, 126 ÷ 16 = 7 r 14 (E), 7 ÷ 16 = 0 r 7. Read upwards: 7E8.
  • Binary: write each hex digit as four bits: 7 = 0111, E = 1110, 8 = 1000, giving 111 1110 1000.
  • Octal: regroup the bits in threes from the right: 011 111 101 000 = 3750.
  • Base 36: 2024 ÷ 36 = 56 r 8, 56 ÷ 36 = 1 r 20 (K), giving 1K8.

The shortcut between binary, octal and hex works because 8 and 16 are powers of 2: one octal digit is exactly three bits and one hex digit is exactly four.

Common Values in Each Base

DecimalBinaryOctalHex
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
15 1111 17 F
16 10000 20 10
31 11111 37 1F
32 100000 40 20
63 111111 77 3F
64 1000000 100 40
100 1100100 144 64
127 1111111 177 7F
128 10000000 200 80
255 11111111 377 FF
256 100000000 400 100
1000 1111101000 1750 3E8

Exact Results for Large Numbers

Converters built on ordinary JavaScript numbers hold integers exactly only up to 9,007,199,254,740,991 (253 − 1), and Excel keeps just 15 significant digits. Beyond that the last digits are silently rounded, so a 64-bit hex value such as FFFFFFFFFFFFFFFF comes back as 18446744073709552000 instead of 18446744073709551615. This converter reads digits one at a time into an arbitrary-precision integer, so results stay exact whether you paste a Snowflake ID, a 128-bit UUID in hex or a 2048-bit RSA modulus. The bit count shown under the results tells you how wide a field you need to store the value.

Where Each Base Is Used

Binary describes bits, flags and network masks. Octal survives mainly in Unix file permissions such as chmod 755. Hexadecimal is the compact way to write bytes: colours like #FF8800, memory addresses, hashes and Unicode code points. Base 36 packs numbers into short alphanumeric IDs, as used by some URL shorteners. To convert text rather than numbers, use the hex to text converter.

Related Tools

Frequently Asked Questions

How large a number can I convert?
There is no fixed limit. The converter uses JavaScript BigInt, so a 64-bit value like 18446744073709551615 or a 300-digit number converts exactly. Ordinary JavaScript numbers lose precision above 9007199254740991 (2^53 - 1); this tool does not.
Can I paste numbers with 0x, 0b or spaces?
Yes. A 0x prefix is accepted for hexadecimal, 0b for binary and 0o for octal, as long as it matches the selected input base. Spaces, underscores and commas are ignored, so '1111 0000', '0xFF_FF' and '1,000,000' all work.
How are negative numbers shown?
Negative numbers keep a minus sign in every base, so -255 becomes -FF in hex and -11111111 in binary. The tool does not produce two's complement, because that depends on a word size (8, 16, 32 or 64 bits). For an 8-bit two's complement value, add 256 to the negative number first: -1 + 256 = 255 = 11111111.
What digits are used above base 10?
Bases above 10 use letters after 9: A = 10, B = 11, up to Z = 35 in base 36. Input is case-insensitive, and output uses capitals.
What does digit grouping do?
Grouping splits long results so they are easier to read and compare. Binary and hex are grouped in fours (binary is padded to whole nibbles), decimal uses commas every three digits, and other bases use spaces every three digits.