Skip to the content

Decimal to Binary Converter

Type a decimal number and get it in binary, with the divisions by two that lead to each bit written out.

Type a decimal number in the first field and read it in binary in the second. It works the other way round as well. Whole numbers only; spaces, underscores and the prefixes 0b, 0o and 0x are fine.

Working

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

The remainders from the last to the first: 10011100

Other bases

from 2 to 36
Bit length
8 bits
Fits in
1 byte
Share this tool:TwitterFacebookLinkedInWhatsAppEmail

How to convert decimal to binary by hand

Divide the number by 2 and write down the remainder, which is 0 or 1. Divide the result by 2 again, and keep going until nothing is left.

The remainders are the binary digits in reverse order: the first remainder is the right-hand digit. For 156 the remainders are 0, 0, 1, 1, 1, 0, 0 and 1. Read from the last to the first they give 10011100.

The other way is to take away powers of two. Find the largest one that fits, write a 1 for it, and carry on with what is left. 156 = 128 + 16 + 8 + 4, so there is a 1 in the places for 128, 16, 8 and 4 and a 0 everywhere else.

The working under the two fields at the top of the page does this for whatever number you type.

Good to know

  • The first remainder already tells you something: odd numbers end in 1, even numbers in 0.
  • A number below 256 fits in eight bits. Computers show it with zeros in front to fill the byte, so 5 appears as 00000101. That is the same number as 101.
  • Fractions are not converted here. Most decimal fractions, 0.1 among them, have no finite binary form.

Decimal to binary table

DecimalBinary
00
11
210
311
4100
5101
6110
7111
81000
91001
101010
111011
121100
131101
141110
151111
161 0000
DecimalBinary
201 0100
3210 0000
5011 0010
64100 0000
100110 0100
127111 1111
1281000 0000
2001100 1000
2551111 1111
2561 0000 0000
5001 1111 0100
51210 0000 0000
100011 1110 1000
1024100 0000 0000
40961 0000 0000 0000
655351111 1111 1111 1111

The number base converter shows binary, octal, decimal and hexadecimal next to each other, and explains positional notation and two's complement.

See all 9