Finance 44 tools → Date 19 tools → Health 27 tools → Everyday 23 tools → Math 19 tools → Construction 16 tools → PDF 23 tools → Education 10 tools → Conversion 7 tools → Text 12 tools → Image 8 tools → About → Contact →

Number Base Converter

Runs entirely in your browser — your numbers are never sent anywhere.

Decimal value
—

Detail

Conversion working

Counting in different bases

Decimal feels natural only because we learn it first. A number base (or radix) is simply a choice of how many digit symbols to use before carrying into the next place: decimal uses ten digits (0–9), binary uses two (0–1), octal uses eight (0–7) and hexadecimal uses sixteen (0–9 then A–F for ten to fifteen). The value of a number does not change when its base changes — 255, 11111111, 377 and FF are four spellings of exactly the same quantity — only the spelling changes. This converter translates between all four bases and shows the working, not just the answer.

How positional notation works

Value = sum of (digit × baseposition), counting positions from 0 at the right

In decimal, 255 means 2 × 102 + 5 × 101 + 5 × 100 = 200 + 50 + 5. The same rule in any base explains every conversion here: binary 11111111 means 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255, and hexadecimal FF means 15 × 16 + 15 = 255. To convert from any base, expand in powers of that base as in the step-by-step panel. To convert a decimal number to binary, repeatedly divide by 2 and read the remainders backwards — the detail section shows that division table for your value.

Why computers use binary, octal and hex

Computer circuits have two stable states, so binary is their native language — but long binary strings are unreadable for humans. Octal and hexadecimal are compression formats for binary: each octal digit stands for exactly three binary digits, and each hex digit for exactly four, so converting between them is just regrouping, with no arithmetic. That is why memory addresses, colour codes such as #FF5733, file permissions and network settings are written in hex. A byte is eight binary digits, which is exactly two hex digits, running from 00 to FF (0 to 255) — the default example on this page.

Digits must be smaller than the base

The one input rule: every digit must be less than the base. Binary cannot contain a 2, octal cannot contain an 8 or 9, and decimal cannot contain the letter A. If you enter a digit that is not allowed in the source base you selected, this converter says so plainly instead of silently guessing — a surprisingly common source of wrong answers in other tools, where an input like 102 in binary mode might be misread as decimal. Hexadecimal input is case-insensitive, so ff, FF and Ff are identical.

Worked example

Decimal 42 converts as follows: binary 101010 (32 + 8 + 2), octal 52 (5 × 8 + 2), hexadecimal 2A (2 × 16 + 10, where A means ten).

How to use this calculator

  1. Type the number exactly as it is written in its original base.
  2. Select that source base — decimal, binary, octal or hexadecimal.
  3. Read the decimal value in the green panel and all four bases in the breakdown table.
  4. For a decimal input, study the repeated-division table below; for other bases, follow the positional expansion.
  5. If you get an invalid-digit message, check each digit is smaller than the source base.

Quick mental conversions worth memorising

A few anchors make base work much faster. Powers of two double each step — 1, 2, 4, 8, 16, 32, 64, 128, 256 — and a binary number is just a shopping list of those powers. F in hex is 15, 10 in hex is 16 (not ten), and 100 in hex is 256. In the other direction, decimal 10 is A in hex and 1010 in binary. Programmers also meet base 2 prefixes (0b), base 8 (0o) and base 16 (0x) in code, which are labels, not part of the number. For longer expressions involving powers and roots across bases, convert to decimal first with this tool, then use the Scientific Calculator.

Frequently asked questions

Why does hexadecimal use letters?
It needs sixteen distinct digit symbols but numerals only provide ten, so the letters A to F stand for the values ten to fifteen. F is a single digit in hex, worth fifteen — not the two decimal digits 1 and 5.
How do I convert binary to decimal by hand?
Write the powers of two over the digits from the right (1, 2, 4, 8, 16...) and add the powers where the digit is 1. Binary 1010 gives 8 + 2 = 10. The positional-expansion steps below the calculator do exactly this for your number.
Can this converter handle fractions or negative numbers?
No — it converts whole numbers (integers) only, which covers addresses, colour codes, permissions and most exam questions. Fractional values in other bases need a separate method for the part after the point.
Keep going

Related math calculators