What a base actually is
A base, or radix, is the number of distinct digits a numeral system uses and the factor by which each place is worth more than the one to its right. Decimal has ten digits, 0 through 9, and each column is ten times the last. Binary has two, 0 and 1, and each column doubles. Hexadecimal has sixteen, so it borrows A through F for the values ten to fifteen. Base 36 exhausts the Latin alphabet: Z stands for 35.
What does not change is the quantity. The string 255, the string FF and the string 11111111 all denote the same number of things; they are three spellings, not three values. This is the single idea that makes base conversion feel obvious once it lands: you are re-spelling a quantity, not transforming it. Nothing about the number itself is base-dependent — whether it is prime, whether it is even, what it is divisible by. A number that is a multiple of 3 stays a multiple of 3 in every base.
Positional notation says a digit's contribution is its face value times a power of the base. Reading 255 in base 10, the digits contribute 2×10² + 5×10¹ + 5×10⁰ = 200 + 50 + 5. Reading the same characters in base 16 gives 2×256 + 5×16 + 5 = 597, which is why you must always state the base a numeral is written in. The subscript notation 255₁₆ or the programming prefixes 0x, 0b and 0o exist for exactly this reason.
The rule extends past the point. Digits to the right of the radix point take negative powers: in binary, 0.11 means 1×2⁻¹ + 1×2⁻² = 0.5 + 0.25 = 0.75. Nothing about the method changes; only the exponent goes negative.
The two algorithms, and why they are opposites
Every conversion between arbitrary bases is done in two stages: read the source digits into a plain quantity, then write that quantity out in the target base. This calculator shows both stages, and each has its own method.
Reading in — the positional sum. Multiply each digit by its place value and add. In practice you do not need the powers at all: Horner's method walks the digits left to right, multiplying the running total by the base and adding the next digit. For 1234 in base 5 that is 1, then 1×5+2 = 7, then 7×5+3 = 38, then 38×5+4 = 194. Four multiplications, no exponents, and no intermediate value larger than the answer.
Writing out — repeated division. Divide the quantity by the target base. The remainder is the last digit, because it is precisely the part that does not reach one full unit of the next place up. Then divide the quotient again for the next digit, and keep going until the quotient is zero. The digits emerge least significant first, which is why you read them upwards from the bottom of the table. That single fact accounts for most hand-conversion errors.
The two stages are inverses, which is worth checking whenever you are unsure. Convert forward, convert back, and you must land on what you started with. The long division calculator shows any one of those division steps in full detail, and the quotient-and-remainder pair it produces is exactly what the digit extraction relies on.
Fractions run the other way round. Instead of dividing and keeping remainders, you multiply the fractional part by the target base and keep the whole part that pops out in front of the point. Multiply 0.6875 by 2 to get 1.375: the digit is 1 and 0.375 carries on. This produces digits most significant first, so you read downwards. The process may never terminate: one third is 0.333… in decimal and 0.0101… repeating in binary, and one tenth — exact in decimal — repeats forever in binary. A fraction terminates in base b exactly when its denominator, in lowest terms, has no prime factor outside the primes dividing b. That is why tenths repeat in binary but thirds do not repeat in base 12 or base 36.
Power-of-two bases get a shortcut. Because 16 = 2⁴, every hex digit maps to exactly four bits and no arithmetic is needed: F is 1111, 5 is 0101, so 0x5F is 01011111. Likewise one octal digit is three bits. Converting between binary, octal and hexadecimal is regrouping, not calculating, which is the whole reason those two bases became the standard shorthand for bit patterns.
Worked example: 1234₅ to base 7, and 0.6875 to binary
Stage 1 — read 1234 in base 5 as a quantity. The place values are 5³ = 125, 5² = 25, 5¹ = 5 and 5⁰ = 1.
- 1 × 125 = 125
- 2 × 25 = 50
- 3 × 5 = 15
- 4 × 1 = 4
- Total: 125 + 50 + 15 + 4 = 194.
Stage 2 — write 194 in base 7 by repeated division.
- 194 ÷ 7 = 27 remainder 5. Last digit: 5.
- 27 ÷ 7 = 3 remainder 6. Next digit: 6.
- 3 ÷ 7 = 0 remainder 3. Next digit: 3. The quotient is 0, so stop.
- Read the remainders upwards: 365₇.
Check it by expanding back: 3 × 49 + 6 × 7 + 5 = 147 + 42 + 5 = 194. ✓ Note that 365₇ and 365₁₀ share their digits and share nothing else — a good reminder that a numeral without a stated base is ambiguous.
A fraction: 0.6875 decimal into binary. Multiply by 2 and harvest the whole part each time.
- 0.6875 × 2 = 1.375 → digit 1, carry 0.375
- 0.375 × 2 = 0.75 → digit 0, carry 0.75
- 0.75 × 2 = 1.5 → digit 1, carry 0.5
- 0.5 × 2 = 1.0 → digit 1, carry 0. Terminated.
- Reading downwards: 0.6875 = 0.1011₂.
Verify: 1/2 + 0/4 + 1/8 + 1/16 = 0.5 + 0.125 + 0.0625 = 0.6875. ✓ It terminated because 0.6875 = 11/16 and 16 is a power of 2. Try 0.1 instead and the digits run 0.000110011001… forever, which is the origin of the classic floating-point surprise that 0.1 + 0.2 does not equal 0.3.
How to read the result
Digit count tells you how much room the number needs. Writing n in base b takes ⌊logb n⌋ + 1 digits, so a smaller base always needs more digits for the same quantity. 255 is three digits in decimal, two in hex and eight in binary. That trade — fewer symbols, longer strings — is the only thing you are choosing between when you pick a base.
A result that is all the maximum digit means you are at a boundary. FF in hex, 111111112 in binary and 377 in octal are all 255, one below 256 = 2⁸. Any base-b numeral consisting of k copies of the digit b−1 equals bk − 1, which is why 255, 65535 and 4294967295 keep appearing in computing: they are the largest values that fit in 8, 16 and 32 bits.
Trailing zeros carry information. A number ends in k zeros in base b exactly when it is divisible by bk. Binary numbers ending in three zeros are multiples of 8; decimal numbers ending in two zeros are multiples of 100. That is also the quickest divisibility test available in any base: look at the last digit to test divisibility by any factor of the base.
Watch the exact-integer ceiling. This converter is exact for whole numbers up to 2⁵³ ≈ 9.007 × 10¹⁵, the limit of exact integer arithmetic in a browser. Above that, low-order digits can be wrong, and the calculator says so. A 12-digit base-36 string already exceeds that ceiling, since 36¹² ≈ 4.7 × 10¹⁸, so split long identifiers into chunks before converting them.
Finally, the fractional part is computed in binary floating point, so a fraction that repeats in the target base is approximated. The whole-number part carries no such caveat.
Reference: the same values in five bases
| Decimal | Binary (2) | Octal (8) | Hex (16) | Base 36 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 5 | 101 | 5 | 5 | 5 |
| 8 | 1000 | 10 | 8 | 8 |
| 10 | 1010 | 12 | A | A |
| 15 | 1111 | 17 | F | F |
| 16 | 10000 | 20 | 10 | G |
| 35 | 100011 | 43 | 23 | Z |
| 36 | 100100 | 44 | 24 | 10 |
| 64 | 1000000 | 100 | 40 | 1S |
| 194 | 11000010 | 302 | C2 | 5E |
| 255 | 11111111 | 377 | FF | 73 |
| 1,295 | 10100001111 | 2417 | 50F | ZZ |
| 4,095 | 111111111111 | 7777 | FFF | 36F |
Check the last row: FFF = 15×256 + 15×16 + 15 = 4,095 = 2¹² − 1, and 3×1,296 + 6×36 + 15 = 3,888 + 216 − nothing left over = 4,095 in base 36.
Why 36 is the ceiling
The limit is not mathematical — bases run to infinity — but notational. Conventional digit strings use 0-9 followed by A-Z, which supplies exactly 36 symbols, and base 36 is therefore the largest radix that can be written with ordinary alphanumerics and read unambiguously. Beyond it you need a new convention: base 64 encoding, for example, adds two more characters and is a byte-packing scheme rather than a positional numeral system. At the other end, base 1 does not exist as positional notation: with a single digit symbol every place value would be 1k = 1, and the sum could never distinguish position.
Mistakes that produce the wrong conversion
- Reading the remainders downwards. Repeated division yields the least significant digit first. The first remainder you compute is the last digit of the answer.
- Using a digit the base does not have. There is no 8 in octal and no 2 in binary. A string like 129 is simply not an octal numeral, and this calculator rejects it rather than reinterpreting it.
- Assuming a terminating decimal terminates in binary. 0.1 and 0.2 are exact in base 10 and repeat forever in base 2. That is why money is normally handled in integer cents rather than binary floating point.
- Dividing by the source base instead of the target base. The repeated-division stage always divides by the base you are converting into.
- Confusing a numeral with a value. 10 means two in binary, eight in octal, ten in decimal and sixteen in hex. Always carry the base with the numeral.
- Expecting negative numbers as bit patterns. This tool writes a minus sign in front. Two's complement is a fixed-width representation, so −5 has no answer until you say whether the word is 8, 16 or 32 bits wide.
- Converting values past 2⁵³ in one go. Long hex hashes and base-36 identifiers exceed exact integer range; convert them in chunks of a few digits.
Which base to use, and where each one comes from
Binary is the base of physical computing because a circuit reliably distinguishes two states, not ten. Everything above it is human convenience. Hexadecimal caught on because 16 = 2⁴ makes each digit exactly one nibble, so a byte is always two hex characters and no arithmetic is needed to move between the two — which is why memory addresses, colour codes and hash digests are written in hex. Octal held the same role on machines with 12-, 24- or 36-bit words, and survives in Unix file permissions, where three bits of read/write/execute map onto one octal digit.
Base 36 turns up wherever a number has to be squeezed into a short alphanumeric string: shortened URLs, invoice references, and licence keys. Base 12 has a mathematical argument behind it — 12 has four proper divisors against 10's two, so thirds and quarters terminate — and it survives in inches, hours and dozens. Base 60, inherited from Babylonian astronomy, is still how you read a clock and a compass.
Two neighbouring ideas are often confused with base conversion. Scientific notation rewrites a number as a mantissa times a power of ten; the base is unchanged, only the layout differs. And Base64 encoding, despite the name, packs three bytes into four characters rather than evaluating a positional sum — the Base64 size calculator covers what that does to a payload.
For the number-theoretic side of bases, the modulo calculator handles the remainder arithmetic that digit extraction depends on, and the prime factorization calculator tells you which fractions will terminate in a given base: the answer depends only on which primes divide the base. If you work with hex colour values, the hex to RGB converter applies the same base-16 reading to three channels at once.
Key terms
- Base (radix)
- The number of digit symbols a numeral system uses, and the ratio between adjacent place values. Base 16 uses sixteen symbols and each column is worth sixteen times the one to its right.
- Positional notation
- A writing system in which a digit's value depends on its position, as digit × base^position. Roman numerals are not positional; every system this calculator handles is.
- Most / least significant digit
- The leftmost digit contributes most to the value; the rightmost contributes least. Repeated division produces the least significant digit first.
- Nibble
- Four bits — exactly one hexadecimal digit. Two nibbles make a byte, so a byte is always two hex characters.
- Two's complement
- The standard fixed-width representation of signed integers in hardware, where the top bit carries negative weight. It requires a stated word size, so it is not a base conversion.
- Terminating fraction
- A fraction whose base-b expansion ends. In lowest terms it terminates exactly when the denominator's prime factors all divide b.
