Decimal to Binary Converter
To convert a decimal number to binary, divide by 2 again and again and read the remainders from bottom to top. This converter does it for any size of number and shows every step, handles fractions and negative numbers, and converts back from binary — perfect for homework, computer science classes and programming.
Decimal to binary converter
Binary to decimal
Binary Conversion Worksheet Pack
Decimal-to-binary and binary-to-decimal worksheets with step-by-step answer keys, a binary place value chart, a powers of two table and binary flash cards.
- Decimal to binary (PDF/DOCX)
- Binary to decimal (PDF/DOCX)
- Place value chart (PDF)
- Powers of two (PDF/XLSX)
- Flash cards (PDF)
Formats: PDF, DOCX, XLSX. Instant download after payment (link valid 72 hours, up to 5 downloads). AI-assisted: the templates were drafted with AI help and reviewed and laid out by Kedop.
$5.00 USD, one-time
Secure card checkout by Stripe. Full refund within 7 days — see the refund policy and license.
The division method, step by step
| Division | Quotient | Remainder |
|---|---|---|
| 156 ÷ 2 | 78 | 0 |
| 78 ÷ 2 | 39 | 0 |
| 39 ÷ 2 | 19 | 1 |
| 19 ÷ 2 | 9 | 1 |
| 9 ÷ 2 | 4 | 1 |
| 4 ÷ 2 | 2 | 0 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Reading the remainders from the bottom up gives 10011100, so 156 in decimal is 10011100 in binary. Check: 128 + 16 + 8 + 4 = 156.
Binary place values
| Bit position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Value (2ⁿ) | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| 156 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 |
Another way to convert is subtraction: take the largest power of two that fits (128), subtract it (28 left), then the next that fits (16, leaving 12), then 8 (leaving 4), then 4 — and put a 1 in each of those positions.
Fractions
For the part after the decimal point, multiply by 2 repeatedly: the whole-number part of each result (0 or 1) is the next binary digit, read from the top down. 0.625 × 2 = 1.25 (1), 0.25 × 2 = 0.5 (0), 0.5 × 2 = 1.0 (1), so 0.625 = 0.101 in binary. Many decimal fractions, like 0.1, never end in binary — which is why computers store them approximately and 0.1 + 0.2 doesn’t give exactly 0.3 in floating-point arithmetic.
Negative numbers: two’s complement
| Decimal | 8-bit two’s complement |
|---|---|
| 0 | 00000000 |
| 1 | 00000001 |
| -1 | 11111111 |
| -42 | 11010110 |
| 127 | 01111111 |
| -128 | 10000000 |
Computers usually store signed integers in two’s complement: to negate a number, invert every bit and add 1. With 8 bits the range is −128 to 127; with 16 bits, −32,768 to 32,767. The leading bit is 1 for negative numbers.
Worked example
A student converts 42 to binary: 42 ÷ 2 = 21 r0, 21 ÷ 2 = 10 r1, 10 ÷ 2 = 5 r0, 5 ÷ 2 = 2 r1, 2 ÷ 2 = 1 r0, 1 ÷ 2 = 0 r1. Reading up: 101010. For −42 in 8 bits, pad to 00101010, invert to 11010101 and add 1: 11010110. In the binary-to-decimal box with “two’s complement” ticked, 11010110 reads back as −42.
Powers of two to remember
| 2ⁿ | Value | Where you meet it |
|---|---|---|
| 2^8 | 256 | Values in a byte |
| 2^10 | 1,024 | Kibibyte (KiB) |
| 2^16 | 65,536 | Values in 16 bits |
| 2^20 | 1,048,576 | Mebibyte (MiB) |
| 2^24 | 16,777,216 | 24-bit colours |
| 2^32 | 4,294,967,296 | IPv4 addresses, 32-bit integers |
Decimal, binary, octal and hex side by side
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 31 | 11111 | 37 | 1F |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 127 | 1111111 | 177 | 7F |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
Each hex digit stands for exactly four binary digits and each octal digit for three, which is why programmers use hex as a compact way to write binary: 1111 1111 is FF.
Why computers use binary
Digital circuits are most reliable when they only need to tell two states apart — high or low voltage, on or off, magnetised one way or the other. Binary maps perfectly onto those two states, so every number, letter, image and sound in a computer is ultimately stored as a pattern of 0s and 1s. A group of 8 bits is a byte, which can hold 256 different values — enough for one character in basic text encodings or one colour channel in an image.
Common mistakes
- Reading the remainders from top to bottom instead of bottom to top.
- Forgetting the final division that leaves a quotient of 0 and a remainder of 1.
- Dropping leading zeros when a fixed width, such as 8 bits, is required.
- Applying two’s complement to a positive number — it’s only for negatives.
- Treating binary fractions as if every decimal fraction ends: 0.1 repeats forever in binary.
What’s in the template pack
- Decimal-to-binary worksheets with step-by-step answer keys
- Binary-to-decimal worksheets
- Printable binary place value chart
- Powers of two reference table (2⁰ to 2⁶⁴)
- Binary flash cards (0–31)
For computer science teachers and students; the converter itself is free.
Privacy
All conversions run in your browser.
Frequently asked questions
How do I convert decimal to binary?
Divide by 2 repeatedly and read the remainders from bottom to top.
What is 10 in binary?
1010.
What is 255 in binary?
11111111 — eight ones.
How do I convert a decimal fraction to binary?
Multiply the fraction by 2 repeatedly and take the whole-number digit each time.
How are negative numbers shown in binary?
Usually in two’s complement: invert the bits and add 1.
Can it convert very large numbers?
Yes — it uses arbitrary-precision integers.
What is a bit and a byte?
A bit is one binary digit; a byte is 8 bits.
How many bits do I need for a number?
The number of binary digits: n needs ⌊log₂ n⌋ + 1 bits, so 255 needs 8.
What is 0.5 in binary?
0.1 — one half.
What is the largest 8-bit number?
255 unsigned (11111111), or 127 as a signed two’s complement number.
Is binary the same as base 2?
Yes — binary is the base-2 number system.