Decimal to Binary Converter

Type a decimal number to get its binary value, with the division steps shown underneath.

Decimal numbers use the digits 0 to 9.

Binary result
Result appears as you type

How to convert decimal to binary by hand

Example 1: 156 in decimal is 10011100 in binary

Decimal to binary: divide by 2 and keep the remainders

Divide by 2 until the quotient is 0. The remainders, read from the bottom up, are the binary digits.

NumberDivisionQuotientRemainder
156156 ÷ 2780
7878 ÷ 2390
3939 ÷ 2191
1919 ÷ 291
99 ÷ 241
44 ÷ 220
22 ÷ 210
11 ÷ 201

Reading the remainders from bottom to top gives 10011100

Example 2: 255 in decimal is 11111111 in binary

Decimal to binary: divide by 2 and keep the remainders

Divide by 2 until the quotient is 0. The remainders, read from the bottom up, are the binary digits.

NumberDivisionQuotientRemainder
255255 ÷ 21271
127127 ÷ 2631
6363 ÷ 2311
3131 ÷ 2151
1515 ÷ 271
77 ÷ 231
33 ÷ 211
11 ÷ 201

Reading the remainders from bottom to top gives 11111111

Decimal to Binary conversion table

DecimalBinary
00
11
210
311
4100
5101
6110
7111
81000
91001
101010
111011
121100
131101
141110
151111
1610000
32100000
641000000
1001100100
12810000000
25511111111
256100000000
5121000000000
10001111101000
102410000000000

Where this conversion comes up

  • Working out which bits are set in a flags or permissions value, for example 5 = 101 means bits 0 and 2 are on.
  • Subnet masks: 255 is 11111111, so 255.255.255.0 is 24 ones followed by 8 zeros (a /24 network).
  • Computer science coursework and exams, where you are usually asked to show the repeated division.

Frequently asked questions

How many bits do I need to store a number?

Count the digits in its binary form. Any number from 2ⁿ⁻¹ to 2ⁿ − 1 needs n bits, so 255 needs 8 bits and 256 needs 9.

Why do I read the remainders from the bottom up?

The first division gives the remainder for the 1s place (the rightmost bit), the next for the 2s place, and so on. The last remainder is the leftmost bit, so reading upwards puts them in the right order.

Can I convert negative numbers?

Yes. Put a minus sign in front and it is kept in the result, for example -156 becomes -10011100. The converter does not produce two's complement.

Is there a limit on how big the number can be?

No practical limit. The conversion uses arbitrary precision integers, so long values stay exact. The step-by-step working is shown for numbers up to 24 digits.

Can I convert fractions?

Not with this tool. It converts whole decimal numbers to whole binary numbers.

Other number converters

Going the other way? Use the Binary to Decimal Converter. To see a number in every base at once, try the all-in-one number converter.

Local Processing
End-to-End Encryption
Works Offline

Building Something Beyond This Tool?

We help teams design and build reliable web and mobile applications backed by well-structured APIs.