How the decimal to binary converter works
Type a whole number into the Decimal field and its binary form appears in the result card, grouped into fours so it is easy to read and to compare with the hexadecimal digits. The step-by-step panel opens on the repeated division by 2, with one row for each division, the quotient carried down to the next row and the remainder that becomes each bit.
Below the result, the bit count shows how many binary digits the number needs, and the “fits in” figure gives the smallest standard 8, 16, 32 or 64-bit integer that can store it. To go the other way, use the binary to decimal converter; for hex, octal and other bases, the binary converter.
The repeated division method
Example: 13 ÷ 2 = 6 r 1, 6 ÷ 2 = 3 r 0, 3 ÷ 2 = 1 r 1, 1 ÷ 2 = 0 r 1. Reading upward gives 1101, and 8 + 4 + 1 = 13 confirms it.
Worked examples
Example 1 — repeated division
- Decimal:
- 45
- 45 ÷ 2, 22 ÷ 2: r 1, r 0
- 11 ÷ 2, 5 ÷ 2: r 1, r 1
- 2 ÷ 2, 1 ÷ 2: r 0, r 1
- Read upward: 1 0 1 1 0 1
Binary: 101101
Example 2 — subtracting powers of 2
- Decimal:
- 200
- Largest power that fits: 128 → 72 left
- Next powers that fit: 64 → 8 left, 8 → 0 left
- Bits for 128, 64, 8: 1 1 0 0 1 0 0 0
Binary: 11001000
Every power of 2 that was skipped (32, 16, 4, 2, 1) becomes a 0.
Common decimal numbers in binary
| Decimal | Binary | Hex | Bits |
|---|---|---|---|
| 5 | 101 | 5 | 3 |
| 10 | 1010 | A | 4 |
| 16 | 1 0000 | 10 | 5 |
| 42 | 10 1010 | 2A | 6 |
| 64 | 100 0000 | 40 | 7 |
| 100 | 110 0100 | 64 | 7 |
| 127 | 111 1111 | 7F | 7 |
| 128 | 1000 0000 | 80 | 8 |
| 255 | 1111 1111 | FF | 8 |
| 256 | 1 0000 0000 | 100 | 9 |
| 1,000 | 11 1110 1000 | 3E8 | 10 |
| 1,024 | 100 0000 0000 | 400 | 11 |
| 65,535 | 1111 1111 1111 1111 | FFFF | 16 |
Key facts
- Repeated division by 2 converts any whole number to binary: each remainder is one bit, and the first remainder is the rightmost bit.
- Every power of 2 is a 1 followed by zeros in binary, so 128 is 10000000 and 1,024 is 10000000000.
- A number one less than a power of 2 is all 1s in binary: 127 is 1111111 and 255 is 11111111.
- 255 is the largest number that fits in 8 bits; 256 needs 9.
Common decimal to binary mistakes
- Reading remainders top-down. That reverses the number: 45 would come out as 101101 by luck, but 13 would wrongly become 1011.
- Stopping at quotient 1. Divide once more: 1 ÷ 2 = 0 remainder 1 supplies the leading bit.
- Dropping a 0 remainder. Every division produces a bit, including the zeros in the middle.
- Forgetting to check. Add the place values of the 1 bits; they must give back the number you started with.
Converting decimal to binary is part of England's GCSE computer science content (source: DfE subject content), so it is worth practising with every division written out.
Frequently Asked Questions
What is 10 in binary?
10 in decimal is 1010 in binary. Dividing by 2 gives remainders 0, 1, 0, 1, and reading them from the last to the first gives 1010. Check: 8 + 2 = 10.
What is 100 in binary?
100 is 1100100 in binary. It is 64 + 32 + 4, so the bits for 64, 32 and 4 are 1 and the rest are 0.
Why do you read the remainders from the bottom up?
The first division by 2 finds the remainder for the 1s place, which is the rightmost bit. Each later division finds the next place to the left, so the last remainder is the leftmost bit. Reading from the bottom up writes them in the right order.
Is there a way to convert without dividing?
Yes — subtract powers of 2. Find the largest power of 2 that fits, write a 1 in that place, subtract it, and repeat with what is left. For 156: 128 fits (28 left), then 16 (12 left), 8 (4 left) and 4 (0 left), so 156 is 10011100.
How many bits does a number need?
A positive whole number n needs one more bit than the largest power of 2 that fits in it, which is ⌊log₂ n⌋ + 1. 255 needs 8 bits and 256 needs 9. The converter shows the bit and byte count for every number you enter.
How do you convert a decimal fraction such as 0.625 to binary?
Multiply the fraction by 2 repeatedly and take the whole-number part each time: 0.625 × 2 = 1.25 (1), 0.25 × 2 = 0.5 (0), 0.5 × 2 = 1.0 (1), so 0.625 is 0.101 in binary. This converter handles whole numbers; fractions like 0.1 never end in binary.
Related calculators
Notes & Assumptions
- Decimal input is read as a whole number, exactly, up to 4,096 digits long.
- Negative numbers keep a minus sign, so −45 is −101101. Fixed-width two's complement patterns are a separate representation and are not produced here.
- Decimal fractions are not converted; the FAQ above explains the multiply-by-2 method for them.
This tool is for education and general calculation. Check results that feed into production code against your platform's documentation.