Number Base Converter

Convert integers between binary, octal, decimal, hexadecimal and any base from 2 to 36 — exactly, even for very large numbers.

  • Tested formula
  • Instant results
  • Updated October 7, 2026

Your details

Results Updates as you type

How base conversion works

In a positional number system, each digit is multiplied by the base raised to the power of its position. To convert into decimal, add up those values. To convert out of decimal, divide repeatedly by the new base and collect the remainders.

Value = dₙ × bⁿ + … + d₁ × b¹ + d₀ × b⁰
Example: The decimal number 255 is 11111111 in binary (eight 1-bits: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1), 377 in octal (3 × 64 + 7 × 8 + 7) and FF in hexadecimal (15 × 16 + 15).

Quick reference

DecimalBinaryOctalHex
0000
1111
21022
510155
81000108
10101012A
15111117F
16100002010
321000004020
64100000010040
100110010014464
1281000000020080
25511111111377FF
256100000000400100
1024100000000002000400

Prefixes 0b (binary), 0o (octal) and 0x (hex) are accepted and ignored. Underscores and spaces used as digit separators are removed.

How to use the converter

  1. Type a number in any field — decimal, binary, octal or hexadecimal.
  2. The other bases update instantly. Hexadecimal accepts digits 0–9 and letters A–F in upper or lower case.
  3. Use the custom base field for any base from 2 to 36.

Converting decimal to binary by hand

Repeatedly divide by 2 and record the remainders, then read them from bottom to top:

Example: 45 ÷ 2 = 22 r 1 → 22 ÷ 2 = 11 r 0 → 11 ÷ 2 = 5 r 1 → 5 ÷ 2 = 2 r 1 → 2 ÷ 2 = 1 r 0 → 1 ÷ 2 = 0 r 1. Reading upward: 45 = 101101₂. Check: 32 + 8 + 4 + 1 = 45.

The same method works for any base: divide by 8 for octal or by 16 for hexadecimal, using A–F for remainders 10–15.

Binary ↔ hexadecimal shortcut

Each hexadecimal digit corresponds to exactly four binary digits (bits), so you can convert by grouping bits from the right: 1011 0110₂ = B6₁₆. Octal works the same way with groups of three bits. That’s why programmers use hex as a compact way to write binary data — one byte (8 bits) is always two hex digits, from 00 to FF.

  • 0000 = 0 · 0001 = 1 · 0010 = 2 · 0011 = 3 · 0100 = 4 · 0101 = 5 · 0110 = 6 · 0111 = 7
  • 1000 = 8 · 1001 = 9 · 1010 = A · 1011 = B · 1100 = C · 1101 = D · 1110 = E · 1111 = F

Where each base is used

  • Binary (base 2): how computers store everything — bits, network subnet masks, bit flags.
  • Octal (base 8): Unix file permissions, such as chmod 755 (rwx r-x r-x).
  • Hexadecimal (base 16): web colors (#FF8800), memory addresses, MAC addresses, Unicode code points (U+00E9) and hashes.
  • Base 36: short IDs and URL shorteners, since it uses all digits and letters.

In code, prefixes mark the base: 0b101101 (binary), 0o55 (octal) and 0x2D (hex) all equal 45 in decimal.

Frequently asked questions

How do I convert decimal to binary?
Repeatedly divide by 2 and record the remainders; reading them from last to first gives the binary number. 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1 → 1101.
How do I convert hexadecimal to decimal?
Multiply each digit by 16 raised to its position (counting from 0 on the right) and add. 2F = 2 × 16 + 15 × 1 = 47. The letters A–F stand for 10–15.
Why do programmers use hexadecimal?
Each hex digit represents exactly four binary digits (bits), so one byte is always two hex digits. That makes long binary values like memory addresses and colors (#1F5EFF) much easier to read.
Can I convert very large numbers?
Yes. The converter uses arbitrary-precision integers, so numbers with hundreds of digits are converted exactly. Fractions (digits after a point) are not supported.
What is the largest number in 8 bits?
255, written 11111111 in binary or FF in hexadecimal. With 8 bits there are 256 values, 0 to 255.
How do I convert hex to decimal?
Multiply each digit by a power of 16 and add: 2F = 2 × 16 + 15 = 47.

Last reviewed October 7, 2026. Results are estimates for informational purposes; see our disclaimer.