Number Base Converter

Convert any number between any bases 2–36: binary, octal, decimal, hex, and beyond. Shows positional expansion and repeated-division step-by-step.

🔢 Number Base Converter
Result (target base)
Decimal (base 10)
Binary (base 2)
Binary (grouped nibbles)
Octal (base 8)
Hex (base 16)
Step-by-step working

What is a Number Base?

The number base (or radix) is the number of distinct digit symbols used in a positional numeral system. In positional notation, the value of each digit depends on its position: the digit at position i (counting from 0 on the right) represents that digit multiplied by the base raised to the power i.

Common bases:

  • Base 2 (binary) — digits 0, 1. The language of digital electronics.
  • Base 8 (octal) — digits 0–7. Used in Unix file permissions.
  • Base 10 (decimal) — digits 0–9. Our everyday number system.
  • Base 16 (hexadecimal) — digits 0–9 and A–F. Standard for memory addresses, color codes, and byte-level data.

Binary, octal, and hex are all powers of 2 (2¹, 2³, 2⁴), which means they interconvert without an intermediate decimal step — 4 binary digits map to one hex digit, and 3 binary digits map to one octal digit.

Formula

Converting to decimal (positional expansion): n₁₀ = d_k × b^k + d_{k−1} × b^{k−1} + … + d_1 × b + d_0

Converting from decimal (repeated division):

  1. Divide n by the target base b
  2. Record the remainder (this is the lowest-order digit)
  3. Replace n with the quotient and repeat until n = 0
  4. Read remainders from bottom to top

Direct binary ↔ hex: Group 4 binary digits from the right → each group = one hex digit

Variables:

  • b — the base (radix)
  • d_i — the digit at position i
  • n — the integer value in decimal

How to Use

  1. Enter the number — type in the source number using valid digits for your chosen base (letters A–Z for digits above 9 in bases 11–36).
  2. Select source base — choose the base your number is currently written in (binary, octal, decimal, hex, or custom 2–36).
  3. Select target base — choose the base to convert to.
  4. Click Convert — the result appears in your target base, plus binary, octal, decimal, and hex equivalents shown simultaneously.
  5. Read the steps — the working panel shows the full positional expansion (from any base to decimal) and the repeated-division steps (decimal to any base).

Example Calculations

Example 1 — Decimal 255 to Binary, Octal, Hex

Convert 255₁₀ to all common bases

1
255 ÷ 2 repeatedly: 255 128 64 32 16 8 4 2 1 → remainders bottom-up: 11111111₂
2
Group binary into 3s from right: 011 111 111 = 377₈
3
Group binary into 4s: 1111 1111 → each group = F → FF₁₆
255₁₀ = 11111111₂ = 377₈ = FF₁₆ (this is the maximum value of one byte)
Try this example →

Example 2 — Hex A3 to Decimal and Binary

Convert A3₁₆ to decimal and binary

1
A = 10, so A3₁₆ = 10×16 + 3×1 = 160 + 3 = 163₁₀
2
A₁₆ = 1010₂, 3₁₆ = 0011₂ → 10100011₂
A3₁₆ = 163₁₀ = 10100011₂ = 1010 0011 (nibble groups)
Try this example →

Example 3 — Binary 11010 to Decimal

Convert 11010₂ to decimal

1
1×2⁴ + 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 16 + 8 + 0 + 2 + 0 = 26₁₀
11010₂ = 26₁₀ = 1A₁₆ = 32₈
Try this example →

❓ Frequently Asked Questions

What is a number base (radix)?+
A number base is the count of distinct digit symbols in a positional numeral system. Base 10 has 10 digits (0–9); base 2 has 2 (0, 1); base 16 has 16 (0–9, A–F). The digit at position i from the right represents digit × base^i. So 1A3₁₆ = 1×256 + 10×16 + 3 = 419₁₀.
How do you convert binary to decimal?+
Write out positional values (1, 2, 4, 8, 16, … from right to left). For each 1-bit, add its positional value. Example: 11010₂ = 16+8+0+2+0 = 26₁₀. For fractions: 0.101₂ = 1×(1/2) + 0×(1/4) + 1×(1/8) = 0.5+0+0.125 = 0.625₁₀.
How do you convert decimal to binary?+
Repeatedly divide by 2 and collect remainders. Read bottom-to-top. Example: 26: 26÷2=13 R0, 13÷2=6 R1, 6÷2=3 R0, 3÷2=1 R1, 1÷2=0 R1 → read up: 11010₂. The number of divisions equals the number of bits in the result.
What is hexadecimal and why is it used?+
Hexadecimal (base 16) uses 0–9 and A–F (A=10 through F=15). One hex digit represents exactly 4 bits (a nibble), so two hex digits = one byte. This makes hex very compact for binary data. Memory addresses, CSS color codes (#RRGGBB), IPv6 addresses, and SHA-256 hashes are all shown in hex.
How do you convert between binary and hex directly?+
Group binary digits into nibbles (groups of 4) from the right, padding with leading zeros. Each nibble converts to one hex digit: 0000=0, …, 1001=9, 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F. Example: 10110111₂ → 1011 0111 → B7₁₆. The reverse: expand each hex digit to 4 bits.
How do you convert between binary and octal?+
Group binary digits into groups of 3 from the right (pad with leading zeros). Each group converts to one octal digit (0–7). Example: 11010110₂ → 011 010 110 → 326₈. Reverse: 5₈ = 101₂, 7₈ = 111₂. This works because 8 = 2³ — octal and binary share the same root.
What is octal used for?+
Octal (base 8) was used in early computing because 3-bit groups map naturally to hardware registers. Today its main use is Unix file permissions: “chmod 755” means owner read/write/execute (7=111₂), group read/execute (5=101₂), others read/execute (5=101₂). Octal also appears in some C/C++ literals (prefix 0) and older PDP and IBM mainframe systems.
Can all decimal fractions be represented exactly in binary?+
No — most decimal fractions are repeating in binary. Only fractions whose denominator is a power of 2 terminate in binary (1/2, 1/4, 1/8, etc.). For example, 0.1₁₀ = 0.0001100110011…₂ (repeating). This is why floating-point arithmetic has rounding errors: 0.1 + 0.2 ≠ 0.3 in IEEE 754. The calculator shows up to 12 fractional digits in the target base.
What is base 36 used for?+
Base 36 uses all alphanumeric characters (0–9, A–Z), making it the most compact case-insensitive single-character-per-digit representation. It’s used in URL shorteners (compactly encoding large IDs), vehicle identification numbers (VINs encode manufacturing info), some database ID schemes, and crockford base32 (a variant). Example: 1,000,000₁₀ = LFLS₃₆.
How many hex digits does it take to represent an n-bit number?+
Since each hex digit represents 4 bits: an n-bit number needs ⌈n/4⌉ hex digits. Common sizes: 8-bit (byte) = 2 hex digits (00–FF), 16-bit = 4 hex digits (0000–FFFF), 32-bit = 8 hex digits, 64-bit = 16 hex digits, 128-bit (IPv6 segment, UUID) = 32 hex digits. A SHA-256 hash is 256 bits = 64 hex digits.