Number Base Converter

Convert between binary, octal, decimal, and hexadecimal.

Technology and NetUpdated 2026-10-101 min read
Number Base Converter
Digits must fit the source base.
Answer
...
All forms...

What it does

Computers count in binary while humans read decimal and programmers write hex shorthand, so the same value wears three costumes. Positional notation unites them: each digit multiplies a power of the base by place.

The tool above converts any of binary, octal, decimal, or hexadecimal into any other. Enter the digits, pick both bases, and read the answer with all four forms below.

Hexadecimal packs tidy groups of four bits per digit, which is why memory addresses and colors wear it. Octal groups three bits and survives mainly in file permissions and old hardware.

Leading zeros pad without changing value. Eight bit 00001010 and 1010 name the same ten, and fixed widths keep columns aligned in dumps.

How to use

  1. Enter the digits exactly as written.
  2. Pick the base they are written in.
  3. Pick the target base.
  4. Read the answer, then all forms for cross checks.

Formula

Value = sum of digit x base^place, places counted from zero at the right. Then divide repeatedly by the target base, reading remainders backwards.
base^place
Positional weight growing right to left.
A-F
Hex digits worth 10 to 15.
remainders
Repeated division output read in reverse.

Parsing validates digits against the source base first: a 2 or 8 inside binary input fails loudly instead of guessing.

Worked example

Example: 1010 binary to decimal

Digits 1010, from base 2, to base 10.

  1. Places: 1x2³ + 0x2² + 1x2¹ + 0x2⁰.
  2. Math: 8 + 0 + 2 + 0 = 10.
  3. Answer: 10.
  4. All forms: Bin 1010 · Oct 12 · Dec 10 · Hex A.

Reference table

First sixteen numbers in all bases
DecBinOctHex
0000
1111
711177
81000108
10101012A
15111117F
16100002010
25511111111377FF

Limits

  • Whole numbers only. Fractions need point math.
  • Thirty two digits max for exact conversion.
  • Uppercase hex output. Case carries no value.
  • Signed encodings like two complement excluded.

Common mistakes

  • Reading 1010 as one thousand ten instead of ten.
  • Using decimal digits 8 or 9 in octal.
  • Forgetting hex runs past 9 into letters.
  • Counting array indexes from one in code.
  • Dropping leading zeros that align fixed widths.

Try it yourself

Quick checks. Answers sit tucked under each question.

FF hex to decimal?

15x16 + 15 = 255.

42 decimal to binary?

32 + 8 + 2 = 101010.

Questions

Why does code use hex?

Two hex digits hold one byte exactly, reading denser than eight bits.

What is 0x in front?

A prefix marking hex in code. The converter strips it automatically.

Binary to hex shortcut?

Group bits in fours from the right, then read each group as one hex digit.

What is octal for?

Unix permissions like 755 and some legacy hardware. Niche but alive.

Why do colors use hex?

Six digits pack red, green, blue bytes: FF0000 is full red.

How big can inputs be?

Thirty two digits here for exact math. Bigger needs arbitrary precision tools.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.