Binary to decimal — instant base-10 conversion
This tool converts a binary number (base 2) into its decimal (base 10)
value, and also shows the hexadecimal and octal equivalents. It is built for
students learning number systems, programmers reading register values or bit masks,
and anyone decoding data stored in binary. Spaces between groups are ignored, so
grouped input like 1010 1101 works exactly the same as 10101101.
How it works
Each binary digit stands for a power of two, increasing from right to left:
1, 2, 4, 8, 16, 32, 64, 128, and so on. Only positions where the digit is 1
contribute to the total; positions with 0 add nothing. The conversion method:
- Identify the rightmost digit — that is the 2⁰ = 1 position.
- Move left, doubling the power at each step (2¹ = 2, 2² = 4, 2³ = 8, …).
- Wherever the binary digit is
1, add that power to a running total. - The sum is the decimal value.
The tool strips whitespace, checks the input contains only 0 and 1, parses
it as base 2 using arbitrary-precision arithmetic, and re-renders the same
integer in base 10, base 16 (hex) and base 8 (octal).
Worked example
Take 10101101:
| Bit position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Power of 2 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Digit | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| Contribution | 128 | 0 | 32 | 0 | 8 | 4 | 0 | 1 |
Sum: 128 + 32 + 8 + 4 + 1 = 173
So 10101101 = 173 decimal, AD in hex, 255 in octal, across 8 bits.
Common reference values
| Binary | Decimal | Hex | Notes |
|---|---|---|---|
| 1 | 1 | 1 | Single bit set |
| 1010 | 10 | A | Nibble |
| 1101 | 13 | D | Nibble |
| 11111111 | 255 | FF | Max unsigned byte |
| 1 0000 0000 | 256 | 100 | One byte overflow |
| 1111 1111 1111 1111 | 65535 | FFFF | Max unsigned 16-bit |
When to use this
- Reading CPU register dumps or memory hex dumps in debugging sessions.
- Decoding bitmask values from embedded systems or network protocols.
- Verifying binary-to-decimal conversions done by hand in coursework.
- Understanding IPv4 subnet masks (e.g.
11111111.11111111.11111111.00000000=255.255.255.0).
Grouped input with spaces — such as 1111 0000 — is accepted directly and the
spaces are stripped before conversion. Everything runs in your browser; nothing
is uploaded.