Binary to Decimal Converter
Convert base-2 and base-10 in both directions, with a live per-bit view plus hex and octal. Binary input accepts only 0 and 1.
Convert base-2 and base-10 in both directions, with a live per-bit view plus hex and octal. Binary input accepts only 0 and 1.
To convert a binary (base-2) number to decimal (base-10), add up the place values of every digit that is a 1. Reading right to left, the columns are 1, 2, 4, 8, 16, 32 and so on — each twice the one before. The per-bit cells above light up green for every 1, so you can see which place values are being summed.
For example, 101010 has 1s in the 32, 8 and 2 columns: 32 + 8 + 2 = 42. Type into either box and the other updates instantly — the binary field accepts only 0 and 1, and the decimal field only digits 0–9.
| Binary | Decimal | Hex |
|---|---|---|
| 1 | 1 | 0x1 |
| 10 | 2 | 0x2 |
| 100 | 4 | 0x4 |
| 1000 | 8 | 0x8 |
| 1010 | 10 | 0xA |
| 101010 | 42 | 0x2A |
| 11111111 | 255 | 0xFF |
The same value is shown in hexadecimal (base-16, prefixed 0x) and octal (base-8, prefixed 0o) below the inputs. Hex packs four binary digits into a single character, which is why colour codes and memory addresses use it. Octal groups three bits at a time and still appears in Unix file permissions. All four views describe the exact same number — only the base differs.
Take the eight-bit number 11001010. Write the column values above it from the right — 128, 64, 32, 16, 8, 4, 2, 1 — and add up only the columns with a 1 above them: 128 + 64 + 8 + 2 = 202. That is the whole method: every binary digit is worth twice the one to its right, and the decimal value is simply the sum of the "on" columns. Type 11001010 into the binary box above and the bit cells light up on exactly those four columns.
A binary digit maps cleanly onto the two states a circuit can hold reliably — off or on, low or high voltage. Using just 0 and 1 makes hardware simpler and far less error-prone than trying to distinguish ten separate voltage levels for decimal. Everything else — text, images, sound, this very page — is ultimately stored as long runs of these two digits, which is why converting between binary and decimal is such a common first step when you look under the hood.
chmod 755
are read as octal groups, each standing for three permission bits.Going the other way is just as mechanical: repeatedly divide the decimal number by 2, write down each remainder, then read the remainders from bottom to top. For 202 that is 202 ÷ 2 = 101 remainder 0, 101 ÷ 2 = 50 r 1, 50 ÷ 2 = 25 r 0, 25 ÷ 2 = 12 r 1, 12 ÷ 2 = 6 r 0, 6 ÷ 2 = 3 r 0, 3 ÷ 2 = 1 r 1, and 1 ÷ 2 = 0 r 1. Reading the remainders upward gives 11001010 — back where we started. The Decimal box above does exactly this the moment you type, showing the result in the bit cells so you can check your working. The same doubling pattern is why so many computing limits come in powers of two — 256, 1,024, 65,536 — rather than round decimal numbers, since each extra bit doubles the range of values you can store.
Add the place values of each 1: 101010 has 1s in the 32, 8 and 2 columns, so 32 + 8 + 2 = 42. The per-bit cells above show this visually.
Binary is base-2, so only the digits 0 and 1 are valid. Any other character is stripped automatically as you type. The decimal box likewise accepts only 0–9.
They label the base: 0x marks a hexadecimal (base-16) number and 0o marks an octal (base-8) number. They are conventions used by most programming languages.
Yes — this converter is two-way. Type a number into the Decimal box and its binary form appears above, with the bit cells and hex/octal views updating too.
Binary needs only two states — off and on — which a circuit can store and read reliably. Distinguishing ten voltage levels for decimal would be far more error-prone, so hardware sticks to 0 and 1.
Eight bits (one byte) range from 00000000 to 11111111, which is 0 to 255 in decimal — 256 distinct values in total. That is why each part of an IPv4 address maxes out at 255.
People reach this tool searching for: