vranishop

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.

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

DivisionQuotientRemainder
156 ÷ 2780
78 ÷ 2390
39 ÷ 2191
19 ÷ 291
9 ÷ 241
4 ÷ 220
2 ÷ 210
1 ÷ 201

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 position76543210
Value (2ⁿ)1286432168421
15610011100

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

Decimal8-bit two’s complement
000000000
100000001
-111111111
-4211010110
12701111111
-12810000000

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ⁿValueWhere you meet it
2^8256Values in a byte
2^101,024Kibibyte (KiB)
2^1665,536Values in 16 bits
2^201,048,576Mebibyte (MiB)
2^2416,777,21624-bit colours
2^324,294,967,296IPv4 addresses, 32-bit integers

Decimal, binary, octal and hex side by side

DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
711177
81000108
91001119
10101012A
15111117F
16100002010
3111111371F
321000004020
64100000010040
100110010014464
12711111111777F
1281000000020080
25511111111377FF
256100000000400100

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

What’s in the template pack

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.