Number Base Converter

Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36 — exact for huge values.

1,164 views

How Does Base Conversion Work?

Any base-b number system uses only the digits 0 through b−1, with each position worth a power of b — the same idea as decimal, just with a different number of symbols. Converting from decimal into another base uses the division-remainder method: repeatedly divide the number by the target base and record each remainder, then read the remainders in reverse order. Converting decimal 100 to base 7: 100÷7 = 14 remainder 2, 14÷7 = 2 remainder 0, 2÷7 = 0 remainder 2 — reading the remainders bottom-up gives 202 in base 7.

Converting from any base into decimal uses the reverse idea, the positional-value-sum method: multiply each digit by the base raised to its position's power (counting from 0 on the right) and add the results. So base-7 202 converts back with 2×7² + 0×7¹ + 2×7⁰ = 98 + 0 + 2 = 100. This tool runs both directions simultaneously between any two bases from 2 to 36, using big-integer arithmetic so results stay exact even for very long numbers — no 15-digit rounding like a pocket calculator.

The same two methods generalize to any pair of non-decimal bases too: converting directly from, say, base 5 to base 12 is usually done by first landing on decimal as an intermediate step (base 5 → decimal via positional-value-sum, then decimal → base 12 via division-remainder), which is exactly what this tool automates behind the scenes for any of the 35 possible base combinations from 2 to 36.

What to Know

  • Letters extend the digit set past 10: once a base needs more than 10 symbols, it borrows letters where digits run out — A=10, B=11, up to Z=35 for base 36, the largest base this tool supports. Input is case-insensitive.
  • Hex is popular because it maps cleanly to binary: each hex digit corresponds to exactly 4 bits, so converting binary↔hex is a simple lookup per group of 4 digits, unlike binary↔decimal, which requires full positional arithmetic.
  • Octal (base 8) groups binary by 3 bits: it was common in early computing (Unix file permissions still use it, e.g. 755) because 3 binary digits map to exactly one octal digit.
  • Leading zeros and sign: this converter works with unsigned magnitudes — a negative number should be entered with an explicit minus sign, since base systems above 10 have no reserved character of their own for it.
  • Bases below 2 or above 36 do not exist here on purpose: base 1 (unary) has no meaningful positional digits, and beyond 36 there are no more case-insensitive single-character symbols left in the Latin alphabet plus digits to represent higher digit values unambiguously.

Frequently Asked Questions

Why do programmers use hexadecimal?

One hex digit represents exactly four bits, so a byte is always two hex digits (FF = 255 = 11111111). It is a compact, human-readable view of binary data, memory addresses and color codes.

What is 1010 in binary as decimal?

1010₂ = 1×8 + 0×4 + 1×2 + 0×1 = 10. Reading positions right to left, each carries the next power of two — this is the positional-value-sum method used to convert any base into decimal.

Which characters are valid for bases above 10?

Letters continue where digits end: A=10, B=11 … Z=35. Base 36 therefore uses all digits and all letters; input is case-insensitive.

How do I convert a decimal number to another base by hand?

Use the division-remainder method: divide repeatedly by the target base, record each remainder, and read the remainders in reverse order (last to first). Converting 100 to base 7 gives remainders 2, 0, 2 — read bottom-up that is 202.

Why does a normal calculator lose precision on very large numbers in other bases?

Standard calculators use fixed-precision floating point, which rounds after roughly 15-17 decimal digits. This tool uses big-integer arithmetic instead, so it converts numbers of any length exactly, with no rounding error, even across dozens of digits — the kind of precision cryptography and competitive-programming problems often require.

Comments

No comments yet — be the first to write one!

Similar Tools