Decimal (Base 10) to Binary (Base 2) Converter

Convert decimal numbers to binary.

11111111

255 (base 10) = 11111111 (base 2)

Digits in base 10: 0 to 9. Digits in base 2: 0 and 1.

How to convert Decimal to Binary

Every positional number system works the same way: a digit is worth its own value times the base raised to the power of its position. In base 10 the place values, from the right, are 100 = 1, 101 = 10, 102 = 100 and so on.

To get from decimal to base 2, divide the number by 2 over and over. Every remainder is one digit of the answer, starting with the last digit, so you read the remainders from the bottom up.

The method

divide by 2, keep the remainder, repeat until the quotient is 0the answer is the remainders read from last to firstdigits in base 10: 0 to 9digits in base 2: 0 and 1

Worked example 1: 45 from decimal to binary

45 ÷ 2 = 22 remainder 122 ÷ 2 = 11 remainder 011 ÷ 2 = 5 remainder 15 ÷ 2 = 2 remainder 12 ÷ 2 = 1 remainder 01 ÷ 2 = 0 remainder 1Read the remainders from the bottom up: 10110145 (base 10) = 101101 (base 2)

Remainders come out last digit first, which is why you read them from the bottom up.

Worked example 2: 255 from decimal to binary

255 ÷ 2 = 127 remainder 1127 ÷ 2 = 63 remainder 163 ÷ 2 = 31 remainder 131 ÷ 2 = 15 remainder 115 ÷ 2 = 7 remainder 17 ÷ 2 = 3 remainder 13 ÷ 2 = 1 remainder 11 ÷ 2 = 0 remainder 1Read the remainders from the bottom up: 11111111255 (base 10) = 11111111 (base 2)

Worked example 3: 1000 from decimal to binary

1,000 ÷ 2 = 500 remainder 0500 ÷ 2 = 250 remainder 0250 ÷ 2 = 125 remainder 0125 ÷ 2 = 62 remainder 162 ÷ 2 = 31 remainder 031 ÷ 2 = 15 remainder 115 ÷ 2 = 7 remainder 17 ÷ 2 = 3 remainder 13 ÷ 2 = 1 remainder 11 ÷ 2 = 0 remainder 1Read the remainders from the bottom up: 11111010001000 (base 10) = 1111101000 (base 2)

Need the other direction? Open the Binary to Decimal converter.

Decimal to Binary examples

The decimal number 255 is written 255 in decimal and 11111111 in binary.

Common Decimal to Binary values
DecimalBinary
11
210
7111
81000
101010
151111
1610000
32100000
641000000
1001100100
25511111111
10001111101000

Where Decimal to Binary comes up

Decimal is the base 10 system everyone learns first, with the digits 0 to 9. It is the form people read: prices, measurements, ages and IDs. It is also the base we calculate in by hand, which is why the worked steps on this page pass through decimal.

Binary uses only 0 and 1, because a digital circuit has two stable states: off and on. Every number a computer stores is binary underneath. You meet it when you work with bit flags, bit masks, subnet masks and low-level debugging.

Going to a smaller base spreads the same value over more digits, so the result is longer. The number 255 needs 3 digits in decimal and 8 in binary.

Decimal to Binary FAQ

How do I convert decimal to binary?

Divide the decimal number by 2, write down the remainder, and repeat with the quotient until it reaches 0. The remainders, read from last to first, are the base 2 number.

Which digits does decimal use?

Base 10 uses the digits 0 to 9. For example, A is not a valid digit in base 10.

Will the binary number be longer or shorter?

Longer. Going to a smaller base spreads the same value over more digits, so the result is longer. Roughly 3.32 binary digits for every decimal digit. The number 255 needs 3 digits in decimal and 8 in binary.

What is 255 in binary?

255 in decimal is 11111111 in binary. Both are the decimal number 255.

Can I convert negative numbers or fractions?

The converter handles whole numbers, and a leading minus sign works for negatives. Fractions use a different method, where you repeatedly multiply the fractional part by the new base, and they are not supported here.