Number Base Converter

Convert binary, octal, decimal and hexadecimal instantly — with digit validation and every base shown at once. Free, no signup, private. Includes the place-value formula, a 0–32 reference table and FAQs.

Flat vector illustration for the Number Base Converter
Result
FF hex

All bases at once

Binary, decimal, hex — the quick answer

Every number can be written in any base: binary (base 2) uses only 0–1, octal (base 8) uses 0–7, decimal (base 10) uses 0–9, and hexadecimal (base 16) uses 0–9 plus A–F. The same value wears different clothes — 255 in decimal is 11111111 in binary and FF in hex.

The trick to remember: each hex digit is exactly 4 bits, so one byte (8 bits) is always two hex digits. That's why programmers write colors as #FF5733 and memory addresses in hex — it's binary, compressed for human eyes.

A short history: from Leibniz to the byte

Binary is far older than computers. In 1703, Gottfried Wilhelm Leibniz published the first formal treatment of base-2 arithmetic, fascinated that all numbers could be built from just 0 and 1. It stayed a mathematical curiosity until 1854, when George Boole's algebra of true/false gave binary a logic to run on.

Early computers actually flirted with octal — groups of 3 bits fit the 12-, 24- and 36-bit machines of the 1960s. But when IBM's System/360 (1964) standardized the 8-bit byte, hexadecimal won: one byte = exactly two hex digits, no awkward leftovers. Programmers have written 0x prefixes and A–F digits ever since, while decimal remains the base humans do arithmetic in.

Octal never fully died — Unix file permissions like chmod 755 are still octal, three bits per digit, three digits per permission set. Every base survives where it fits best.

How it works: the place-value formula

Each digit's value = digit × baseposition, counting positions from 0 at the right:

decimal value = Σ (digit × baseposition)
Example 1: Convert 1010₂ to decimal.
1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 8 + 0 + 2 + 0 = 10.
Example 2: Convert FF₁₆ to decimal.
F = 15, so 15×16¹ + 15×16⁰ = 240 + 15 = 255 — the maximum value of one byte.
Example 3: Convert 255₁₀ to hex.
255 ÷ 16 = 15 remainder 15 → digits 15, 15 → FF. (Read remainders right-to-left.)

Number base conversion table (0–32)

Decimal alongside binary, octal and hexadecimal:

DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010
17100012111
18100102212
19100112313
20101002414
21101012515
22101102616
23101112717
24110003018
25110013119
2611010321A
2711011331B
2811100341C
2911101351D
3011110361E
3111111371F
321000004020

Landmark numbers across the bases

Certain values show up everywhere in computing — here's how they look in each base:

15F in hex

The biggest single hex digit — binary 1111, four 1-bits.

255max 8-bit value

11111111₂, 377₈, FF₁₆ — the largest number one byte can hold.

1,0242¹⁰

10000000000₂, 2000₈, 400₁₆ — the kilo that started the 1000-vs-1024 debate.

65,535max 16-bit value

FFFF₁₆ — the largest unsigned integer in 16 bits, a classic old limit.

16,777,21524-bit color

FFFFFF₁₆ — every color your screen can show, in one hex number.

101010 in binary

"There are 10 types of people: those who understand binary and those who don't."

Visual guide: binary place values

Read binary like decimal — each column is worth the base times the column to its right. Here 1011₂ adds up to 11:

Place values: 1011₂ = 11₁₀ = B₁₆ worth 8 worth 4 worth 2 worth 1 1 0 1 1 8 + 0 + 2 + 1 = 11 (decimal) = B (hex)

Figure: each binary column doubles in value moving left — add the columns holding a 1 to get the decimal value.

Common mistakes to avoid

Base conversions have sharp edges. Avoid these four:

  • Using digit 8 or 9 in octal. Octal digits run 0–7 only — "8" and "9" don't exist in base 8. The converter above flags invalid digits instead of guessing.
  • Reading hex letters as words. In FF₁₆, each F is the digit fifteen, not a letter. F×16 + F = 240 + 15 = 255 — treat A–F as the numbers 10–15.
  • Dropping leading zeros when grouping. To turn binary into hex, group in fours from the right: 101₂ must become 0101₂ = 5₁₆, not 101 grouped wrongly.
  • Forgetting the 0x prefix is not part of the number. 0xFF and FF are the same value — the 0x just announces "hex ahead." Don't try to convert the x.

Pro tips & mental math

Convert like a programmer with these shortcuts:

  • Hex → binary: one digit at a time. Each hex digit is 4 bits: F = 1111, A = 1010, 5 = 0101. So 0xFA = 1111 1010 — no division needed.
  • Binary → decimal: double and add. Scan left to right, doubling your running total and adding each bit: 1011 → 1, 2, 5, 11. Fast and error-proof.
  • Anchor on powers of two. 2¹⁰ = 1,024, 2¹⁶ = 65,536, 2⁸ = 256. Most "magic numbers" in computing are one of these — or one less.
  • One byte = two hex digits, always. If your hex has an odd number of digits, pad a leading zero: 0xABC is really 0x0ABC. Bytes come in pairs.

Printable cheat sheet

Want the 0–32 base table on paper? Print a clean, ink-friendly cheat sheet with one click — the page header, widgets and navigation are automatically hidden in the printout:

Fun facts

  • Leibniz saw theology in binary. He believed base 2 — everything from 1 (God) and 0 (nothing) — proved creation ex nihilo, and had a medallion minted to celebrate the idea.
  • Your screen colors are hex numbers. #FF5733 means red=FF (255), green=57 (87), blue=33 (51) — every web color is just three bytes written in hexadecimal.
  • Programmers joke in binary. "There are only 10 kinds of people in the world: those who understand binary and those who don't" — 10₂ is 2, so the joke counts exactly two kinds.
  • IPv6 addresses are pure hex. An address like 2001:0db8::1 packs 128 bits into 32 hex digits — written in decimal it would be 39 digits long and unreadable.

The complete guide

It starts with why we count in tens at all, then explains binary, octal, and hexadecimal, with hand conversions worked out step by step.

Read: Number Base Converter — The Complete Guide →

Frequently asked questions

What is hexadecimal used for?

Hexadecimal is shorthand for binary: each hex digit represents exactly 4 bits. It's used for memory addresses, color codes like #FF5733, IPv6 addresses, and anywhere long binary strings need a compact, readable form.

Why do computers use binary?

Hardware works with switches that are on or off, which maps perfectly to two digits: 0 and 1. Binary is the only number system circuits can represent directly and reliably.

How do I convert binary to decimal?

Add the place values of each 1-bit: from the right, the columns are 1, 2, 4, 8, 16 and so on. Example: 1010 = 8 + 0 + 2 + 0 = 10.

What is the difference between octal and hexadecimal?

Both are compact ways to write binary. Octal uses digits 0–7 (each digit = 3 bits) and was popular on early computers; hexadecimal uses 0–9 and A–F (each digit = 4 bits) and won because one byte is exactly two hex digits.

What does the 0x prefix mean?

0x marks a number as hexadecimal in most programming languages — 0xFF means hex FF, which is 255 in decimal. Similarly, 0b marks binary and 0o marks octal.

How many bits are in one hex digit?

Four bits. Each hex digit (0–F) covers values 0–15, which is exactly the range of 4 binary digits. That's why one byte (8 bits) is always written as two hex digits.