Number bases, from binary all the way to base 36

A number base is just an agreement about how many digits exist before you carry. Decimal has ten (0-9), binary has two (0-1), hexadecimal has sixteen (0-9 then A-F). The value never changes — only the spelling: what you write as 255 in decimal is 11111111 in binary and FF in hex, the same way one hundred is C in Roman numerals.

Developers bump into bases constantly: memory addresses and color codes in hex, permission bits and flags in binary, old-school file modes in octal. Converting by hand means long division and remainders; doing it in floating point means silent rounding past 2^53. This converter accumulates with arbitrary-precision integers, so even a 128-bit hash converts exactly.

Open the free Number Base Converter — no signup, runs entirely in your browser.

How to use it

  1. Type or paste the number into the value field — uppercase or lowercase letters both work for bases above 10.
  2. Pick the base it is written in from the From base selector; binary, octal, decimal and hex sit at the top.
  3. Read the binary, octal, decimal and hexadecimal spellings instantly, each with its own copy button.
  4. Set To base (custom) for anything exotic — base 7, base 32, base 36 — and a fifth row appears.

Why this one

  • Arbitrary precision: values far beyond 2^53 convert exactly, because the math runs on big integers instead of floats.
  • Prefix-aware input: 0xFF, 0b1010 and 0o17 are honored when they match the selected base, and flagged clearly when they don't.
  • Negative numbers convert sign-magnitude style — the minus sign is carried to every output, with no two's-complement surprises.
  • Hexadecimal output prints A-F in uppercase for readability.

Frequently asked questions

Why do programmers use hexadecimal?

One hex digit encodes exactly four bits, so a byte is always two hex digits — FF is 11111111. That clean mapping makes hex the natural spelling for memory addresses, byte dumps, color values like #FF8000 and cryptographic hashes, where binary would be four times longer and decimal would hide the bit structure.

What does the 0x prefix mean?

0x marks a hexadecimal literal in C-derived languages, just as 0b marks binary and 0o marks octal. This converter accepts those prefixes only when they match the base you selected — a 0x pasted while the base is set to decimal gets a clear error instead of a silent misread. Fun edge case: in base 36, x is a normal digit, so 0x1A is a perfectly valid number there.

How are negative numbers handled?

Sign-magnitude: the minus sign is treated as decoration on the value, so -10 in decimal becomes -1010 in binary and -A in hex. Two's complement — the way hardware actually stores negatives — is deliberately not applied, because it depends on a bit width you never specified.

Why does the base stop at 36?

The digit alphabet is 0-9 followed by a-z, which gives exactly 36 distinct, unambiguous characters. Beyond that there is no standard notation everyone agrees on, so tools draw the line at 36.

How do I convert decimal to binary by hand?

Divide by two repeatedly and write down the remainders from bottom to top: 13 gives 13, 6, 3, 1 with remainders 1, 0, 1, 1 — so 1101. Each binary place is a power of two (1, 2, 4, 8, 16...), and a 1 in a position means that power is included. Or paste the number above and skip the long division.