What binary actually is
Binary is just counting with two digits instead of ten. We grew up writing numbers in base 10 because we have ten fingers, but there's nothing sacred about that choice. Computers use base 2 because the underlying hardware is built from switches, and switches have two states: off and on. Zero and one. Every photo on your phone, every line of this article, every frame of a Netflix stream eventually lives in your machine as a long pattern of these two digits.
The Binary to Decimal Converter on this page turns a string of zeros and ones into the everyday number it represents, and runs the same trick in reverse — type a decimal number, get its binary form back. Both fields are live. There's no Convert button to press, no sign-up, no popup asking for your email. Type, read the result, move on.
Most binary converters either bury the feature under three menus, gate it behind a free trial, or paste the output into a 600-word ad-stuffed page. This one keeps both fields side by side and shows the answer as you type. That's the whole pitch.
How positional notation works
To read binary, it helps to remember how decimal already works. In the number 342, each digit is a placeholder for a power of ten. The 2 means 2 ones. The 4 means 4 tens. The 3 means 3 hundreds. You add them up:
342 = 3 × 10² + 4 × 10¹ + 2 × 10⁰ = 300 + 40 + 2
Binary uses the same idea, except every position is a power of two instead of a power of ten. From right to left, the position values are 1, 2, 4, 8, 16, 32, 64, 128, 256, and so on — each one double the last. A digit in each slot is either present (1) or absent (0). That's it.
The "1011" written in binary breaks down like this:
1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11
The rightmost digit covers the ones, the next covers the twos, then fours, then eights. You only ever add the position values where the digit is 1. Position values where the digit is 0 contribute nothing. Binary is decimal with fewer choices per slot.
Converting binary to decimal by hand
Here's the recipe. Given any binary number, write the position values above each digit starting from the right (1, 2, 4, 8, 16, 32...). For every position where the digit is 1, add that position value to your running total. Skip the zeros. The total is your decimal number.
Worked example: convert 110101 to decimal.
- Position 0 (rightmost): digit is 1, add 1. Running total: 1
- Position 1: digit is 0, skip. Running total: 1
- Position 2: digit is 1, add 4. Running total: 5
- Position 3: digit is 0, skip. Running total: 5
- Position 4: digit is 1, add 16. Running total: 21
- Position 5 (leftmost): digit is 1, add 32. Running total: 53
So 110101 in binary equals 53 in decimal. Type "110101" into the binary field above and you'll see the same number appear.
The Converter does this internally with one line of JavaScript (parseInt(value, 2)), but the underlying algorithm is what's described above — sum the powers of two corresponding to the 1 bits.
Converting decimal to binary
The reverse direction uses a different trick: repeated division by 2. Take your decimal number, divide by 2, and write down the remainder (always 0 or 1). Then divide the quotient by 2 and write down that remainder. Keep going until the quotient hits 0. Read the remainders from bottom to top — that's the binary form.
Worked example: convert 53 to binary.
- 53 ÷ 2 = 26 remainder 1
- 26 ÷ 2 = 13 remainder 0
- 13 ÷ 2 = 6 remainder 1
- 6 ÷ 2 = 3 remainder 0
- 3 ÷ 2 = 1 remainder 1
- 1 ÷ 2 = 0 remainder 1
Read the remainders bottom-up: 110101. Same number we converted in the previous section, arrived at from the opposite direction. The two methods agree because they describe the same arithmetic from different angles.
There's a faster shortcut once you've memorized the powers of two. Find the largest power of 2 that fits inside your number, subtract it, write down a 1 in that position, and repeat with the remainder. For 53: the largest power of 2 not exceeding 53 is 32 (2⁵). 53 − 32 = 21. The largest power inside 21 is 16 (2⁴). 21 − 16 = 5. Inside 5 we find 4 (2²). 5 − 4 = 1, which is 2⁰. So the 1-bits sit at positions 5, 4, 2, and 0, giving us 110101. Same answer.
Reference table: binary, decimal, hex
Hexadecimal (base 16) shows up alongside binary often enough that it's worth seeing all three formats together. One hex digit packs exactly four binary digits, which is why color codes (#FF8800), memory addresses (0x7FFE), and Unicode code points (U+1F600) are all written in hex — it's shorter to read than the equivalent binary.
| Decimal | Binary | Hexadecimal |
|---|---|---|
| 0 | 0000 | 0 |
| 1 | 0001 | 1 |
| 2 | 0010 | 2 |
| 3 | 0011 | 3 |
| 4 | 0100 | 4 |
| 5 | 0101 | 5 |
| 6 | 0110 | 6 |
| 7 | 0111 | 7 |
| 8 | 1000 | 8 |
| 9 | 1001 | 9 |
| 10 | 1010 | A |
| 11 | 1011 | B |
| 12 | 1100 | C |
| 13 | 1101 | D |
| 14 | 1110 | E |
| 15 | 1111 | F |
| 16 | 10000 | 10 |
Notice how hex resets at 16 the way decimal resets at 10. Every four-bit chunk of binary maps to one hex digit, which is why programmers casually flip between them. The byte 11010110 splits cleanly into 1101 and 0110, which read as D and 6 — so the same byte is 0xD6 in hex, or 214 in decimal.
Why binary matters outside computer science class
Binary isn't only a curiosity for students working through a textbook. A few places it shows up in everyday life:
- File sizes. Storage is built around powers of two — 1 KB is technically 1024 bytes (2¹⁰), not 1000. The "10 GB free" your hard drive reports is rounded from 10,737,418,240 bytes.
- Network masks. An IP subnet mask like 255.255.255.0 makes sense only when you look at it in binary: it's three groups of eight 1s followed by eight 0s, marking which bits belong to the network and which belong to the host.
- Permissions in Unix. The familiar
chmod 755is three octal digits, where each digit is three binary bits for read/write/execute. 7 is 111 (all three permissions), 5 is 101 (read and execute, no write). - Bitwise flags. When a single integer represents a set of yes/no options, each bit is one flag. Game engines, graphics APIs, and config files all use this pattern.
If you've ever wondered why programmers seem to love the numbers 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, and 1024 — those are the powers of two, and they're powers of two because of binary.
Related conversions
Binary is one of several number systems you might need to bounce between. A few neighbors:
- Number Base Converter — converts between binary, octal, decimal, hex, and any base from 2 through 36 in a single tool. Use this when you need anything beyond the binary-decimal pair.
- Text to Binary — converts plain text into its UTF-8 binary representation, character by character. Useful for seeing how letters become bytes.
- Scientific Notation Converter — handles very large or very small decimal numbers in 3 × 10⁸ form, which is a different kind of compact notation for a different audience.
Frequently asked questions
Why does the converter reject numbers like "120" in the binary field?
Binary only uses two digits: 0 and 1. The character 2 doesn't mean anything in base 2. If you type a digit between 2 and 9 into the binary field, the converter shows a validation message rather than silently producing a wrong answer. The decimal field accepts any digit 0 through 9, since those are valid in base 10.
Can the converter handle negative numbers or decimals?
The decimal field accepts non-negative integers only. Negative numbers in binary are usually represented with two's complement encoding, which depends on a chosen bit-width (8-bit, 32-bit, 64-bit) and isn't a single canonical answer the way unsigned binary is. Fractional decimal numbers like 3.14 also aren't handled — those require fixed-point or floating-point binary representation, which is a separate topic.
What's the largest number this can convert?
JavaScript safely handles integers up to 2⁵³ − 1 (about 9 quadrillion), which is far more than anyone types into a converter by hand. In practice you can paste a 30-digit binary string and get a clean decimal answer.
What's the difference between binary and BCD?
Binary-coded decimal (BCD) is a different encoding where each decimal digit is stored separately as a 4-bit binary chunk. The decimal number 49 in BCD is 0100 1001 — the 4 and the 9 each get four bits. In pure binary, 49 is 110001. BCD is older and shows up in financial systems and some legacy hardware; pure binary is what you'll see in nearly everything modern.
Why is 1024 such a special number?
1024 is 2¹⁰ — the smallest power of two that's close to 1000. Storage and memory sizes are built around powers of two because addressing hardware is naturally binary, and 1024 is the convenient round-ish unit. The kibibyte (KiB) is exactly 1024 bytes; the kilobyte (KB) is technically 1000 bytes, though the two are often used interchangeably.
Do I need to learn binary to be a programmer?
Not deeply. Most day-to-day programming is done in decimal or named constants — you almost never type a binary literal. But understanding what binary is (rather than memorizing conversion tables) makes a few things click later: why integer overflow happens, why floating-point arithmetic is imprecise, why some numbers are "round" in computing contexts and others aren't. An hour of learning the concept pays back forever.
Why does the binary representation of 10 start with a 1?
1010 looks confusing because in decimal we read it as "one thousand ten." But in binary, each digit's positional value is different. From right to left: 0 (ones), 1 (twos), 0 (fours), 1 (eights). So 1010 = 8 + 0 + 2 + 0 = 10. The leading 1 is the 8s place, not the thousands place — that's the whole point of changing bases.