Skip to content
Popular Calculators
Browse Math calculators

Number Base Converter

Convert a number between any two bases from 2 to 36, with every common base shown alongside and exact arithmetic at any size.

What do you want to work out?

Spaces, underscores and commas are ignored, so grouped input is fine.

2 is binary, 8 octal, 10 decimal, 16 hexadecimal.

About the Number Base Converter

A number and the way it is written are two different things.

The quantity we call two hundred and fifty-five is written 255 in decimal, FF in hexadecimal, 11111111 in binary and 377 in octal. Four sets of symbols, one quantity. Converting between bases changes the notation and leaves the number entirely alone — much as translating a word changes the spelling without changing what it refers to.

This converter handles any base from 2 to 36, shows the common bases side by side, and — most usefully — breaks a number into its place values so you can see why the conversion works rather than only that it does.

How to Use the Number Base Converter

Convert between two bases. Enter the number, say what base it is written in, and choose the base you want.

Show every common base. Gives binary, octal, decimal and hexadecimal at once, plus a few unusual ones.

Show the place values. Breaks the number down digit by digit, which is the mode worth using if base conversion has never quite clicked.

Spaces, underscores and commas are ignored, so pasting 1010 1010 or 0xDE_AD works without tidying first.

What a Base Actually Means

A base is how many digits you have before you must carry.

Decimal has ten symbols, 0 to 9. Having used them all, you carry into a new column worth ten times as much. Binary has only two, so it carries constantly. Hexadecimal has sixteen, so it carries rarely and packs more into each digit.

Every base works by place value: each column is worth the base times the column to its right, and the rightmost column is always worth 1.

  Decimal 255:
    2 × 10²  +  5 × 10¹  +  5 × 10⁰
    2 × 100  +  5 × 10   +  5 × 1     =  255

  Hexadecimal FF:
    15 × 16¹  +  15 × 16⁰
    15 × 16   +  15 × 1              =  255

  Binary 11111111:
    128 + 64 + 32 + 16 + 8 + 4 + 2 + 1  =  255

Same quantity, three notations. Once you can read the middle column of that table, every base works the same way.

Why base 36 is the limit

The digits run 0 to 9 and then a to z — ten numerals plus twenty-six letters, giving thirty-six symbols. Past that there is no agreed convention for what the next digit should look like, so 36 is where the standard stops.

Base 1 is excluded at the other end for a firmer reason: with only the digit 0, a "base one" number could never represent anything but nothing. Tally marks are sometimes called base one, but they are not a positional system at all.

The Bases That Matter

| Base | Name | Digits | Where it appears | |------|------|--------|------------------| | 2 | binary | 0-1 | all digital hardware | | 8 | octal | 0-7 | Unix file permissions | | 10 | decimal | 0-9 | everyday counting | | 16 | hexadecimal | 0-9, a-f | colours, memory, hashes | | 12 | duodecimal | 0-9, a-b | inches, hours, dozens | | 60 | sexagesimal | — | minutes, seconds, degrees |

Base 60 is the oldest of these, inherited from Babylonian astronomy, and it is still why an hour has 60 minutes and a circle 360 degrees. It survives because 60 divides evenly by 2, 3, 4, 5, 6, 10, 12, 15, 20 and 30 — more than any smaller number.

Why binary and hex go together

One hexadecimal digit is exactly four binary digits. Always, with no arithmetic:

  0 = 0000    4 = 0100    8 = 1000    c = 1100
  1 = 0001    5 = 0101    9 = 1001    d = 1101
  2 = 0010    6 = 0110    a = 1010    e = 1110
  3 = 0011    7 = 0111    b = 1011    f = 1111

So converting between them is a lookup. DE is 1101 1110 — read the table twice. No dividing, no remainders.

This is the whole reason hexadecimal exists in computing. A byte is eight bits, which is exactly two hex digits, so a memory dump reads as pairs instead of as an unbroken run of ones and zeros. Octal fills the same role for three-bit groups, which is why Unix permissions are octal: 755 is three sets of three permission bits.

Step-by-Step Example

Into decimal: multiply each digit by its place value and add.

Out of decimal: divide repeatedly by the target base, and read the remainders upwards.

  255 to binary:
    255 ÷ 2 = 127 r 1     ↑
    127 ÷ 2 =  63 r 1     │
     63 ÷ 2 =  31 r 1     │  read
     31 ÷ 2 =  15 r 1     │  upwards
     15 ÷ 2 =   7 r 1     │
      7 ÷ 2 =   3 r 1     │
      3 ÷ 2 =   1 r 1     │
      1 ÷ 2 =   0 r 1     │
                          = 11111111

Between two non-decimal bases, decimal is the usual staging post — unless the two bases are both powers of two, in which case regrouping the bits directly is quicker.

Hex to binary, without going through decimal. Convert A5:

  A = 1010
  5 = 0101
  → 10100101

Two lookups. Going the long way round — A5 to 165 to 10100101 — gives the same answer with more chances to slip.

A base neither of us uses. What is 2B in base 12?

  2 × 12¹  +  11 × 12⁰
  24       +  11        =  35 in decimal

The B is eleven, exactly as it is in hex. The digits mean the same things; only the column values change.

Exactness at Any Size

This matters more than it sounds.

parseInt( "1111...", 2 ) in any browser or programming language uses ordinary floating-point numbers, which hold about sixteen significant digits. A 64-bit binary string — an entirely ordinary thing to paste in — comes back as 18446744073709552000 when the true value is 18446744073709551615. The last four digits are invented, and nothing warns you.

This converter uses exact whole-number arithmetic throughout. Paste a 128-bit hash and every digit of the result is correct.

Understanding Your Result

The result is the converted number, grouped for readability where there is a convention: fours for binary and hex, threes for decimal.

The common bases line gives binary, octal, decimal and hexadecimal together.

The place values show what each digit contributes.

The about this number line gives digit and bit counts.

The as bits line gives the bit count and how many are set, or the two's complement form for a negative.

When Should You Use This Calculator?

Programming. Reading memory addresses, bit masks, file permissions and error codes.

Web and design. Hex colour codes are base 16, and understanding that FF is 255 explains the whole system.

Networking. IP addresses, subnet masks and MAC addresses are all read in binary or hex.

Computer science coursework. Base conversion is a standard early topic, and the place-value mode shows the method rather than only the answer.

Debugging. A value that looks wrong in decimal often looks obviously wrong in binary — a single stray bit is invisible in one and glaring in the other.

Puzzles and ciphers. Base 36 encodes letters and digits compactly, and turns up in short URLs and identifiers.

Common Mistakes

Reading hex digits as decimal. In 1a, the a is ten, so the value is 26 — not "one point something".

Assuming a leading 0 means octal. Some older languages treat 0755 as octal and 755 as decimal, which is a genuine source of bugs. This converter never guesses: you tell it the base.

Converting digit by digit. 15 in decimal is not 1 then 5 converted separately. The whole number converts at once.

Forgetting that place values are powers. The third column from the right is base², not base × 2.

Trusting parseInt on long values. Correct up to about sixteen digits and silently wrong after that.

Mixing up which base you started in. 11 could be three, eleven, or seventeen. The base is not optional information.

Expecting fractions. This converter handles whole numbers. Fractional bases work the same way with negative powers, but they are a separate topic.

Frequently Asked Questions

What does the base of a number system mean?

How many digits it uses before it has to carry. Base ten uses 0 to 9 then carries into a tens column; base two uses only 0 and 1 and carries far more often. The digits mean different amounts in each system, but the quantity they describe is the same.

Why do computers use binary?

Because a circuit can reliably tell the difference between on and off, but not between ten distinct voltage levels. Two states are easy to make robust and fast, so everything else is built on top of them. Hexadecimal is used for display because each hex digit is exactly four bits.

How high can the base go?

This converter handles 2 to 36. The upper limit comes from using 0 to 9 followed by the twenty-six letters, which gives thirty-six symbols in total. Beyond that there is no agreed convention for what the digits should look like.

Why is hexadecimal so common in programming?

Because one hex digit maps to exactly four binary digits, so conversion is a lookup rather than a calculation. A byte is always two hex digits, which makes memory addresses and colour codes far easier to read than sixteen ones and zeros.

Does converting a number change its value?

No. Only the notation changes. 255, 0xFF and 11111111 in binary are three ways of writing the same quantity, in the same way that a word can be translated without altering what it refers to.

Last reviewed September 18, 2026 by the CalculatorPeak editorial team.