Developer Tools

How to Convert Decimal to Binary

Any whole number can be expressed in binary. The division-by-2 method is the standard approach — mechanical, reliable, and easy to do by hand once you have seen it once.

The division-by-2 method

The algorithm is simple:

  1. Divide the number by 2.
  2. Record the remainder (always 0 or 1).
  3. Use the quotient as the new number and repeat.
  4. Continue until the quotient is 0.
  5. Read the remainders from bottom to top — that is the binary number.

The key insight is “read from bottom to top”. The first remainder you record is the least significant bit (the rightmost in binary). The last remainder is the most significant bit (the leftmost).

Worked example: 214 → 11010110

214÷ 2 =107remainder0
107÷ 2 =53remainder1
53÷ 2 =26remainder1
26÷ 2 =13remainder0
13÷ 2 =6remainder1
6÷ 2 =3remainder0
3÷ 2 =1remainder1
1÷ 2 =0remainder1

Remainders (read bottom to top): 11010110 = 11010110

Simpler example: 13 → 1101

13 ÷ 2 = 6 r 1 → 6 ÷ 2 = 3 r 0 → 3 ÷ 2 = 1 r 1 → 1 ÷ 2 = 0 r 1

Read bottom to top: 1101. Verify: 1×8 + 1×4 + 0×2 + 1×1 = 13 ✓

Quick reference: powers of 2

11
210
4100
81000
1610000
32100000
641000000
12810000000
256100000000
151111
3111111
25511111111

Convert any decimal to binary instantly

Type a number and get the binary output with the division steps shown automatically.

Decimal to Binary Converter →

Frequently asked questions

What is the easiest method to convert decimal to binary?

The division-by-2 method. Divide your decimal number by 2, record the remainder (0 or 1), then divide the quotient by 2 again. Repeat until the quotient reaches 0. Then read the remainders from bottom to top — that sequence is the binary number. It works for any whole positive integer.

How do you convert 13 to binary?

Divide 13 by 2: quotient 6, remainder 1. Divide 6 by 2: quotient 3, remainder 0. Divide 3 by 2: quotient 1, remainder 1. Divide 1 by 2: quotient 0, remainder 1. Read remainders bottom to top: 1101. So decimal 13 = binary 1101.

How do you convert 255 to binary?

255 divided repeatedly by 2 produces remainders: 1, 1, 1, 1, 1, 1, 1, 1 (read bottom to top). Result: 11111111. This is 8 bits all set to 1 — the maximum value of a single byte. Knowing that 255 = 11111111 is one of the most useful conversions in computing.

How do you convert 100 to binary?

100 ÷ 2 = 50 r 0 → 50 ÷ 2 = 25 r 0 → 25 ÷ 2 = 12 r 1 → 12 ÷ 2 = 6 r 0 → 6 ÷ 2 = 3 r 0 → 3 ÷ 2 = 1 r 1 → 1 ÷ 2 = 0 r 1. Read remainders bottom to top: 1100100. So decimal 100 = binary 1100100.

Is there a shortcut for powers of 2?

Yes. Powers of 2 are simple in binary: they are always a 1 followed by zeros. 2 = 10, 4 = 100, 8 = 1000, 16 = 10000, 32 = 100000, 64 = 1000000, 128 = 10000000. For numbers just below a power of 2, all the bits below that power are 1: 15 = 1111, 31 = 11111, 63 = 111111, 127 = 1111111.

Why do computers store numbers in binary?

Transistors — the microscopic switches inside every chip — have two states: on and off. These map perfectly to 1 and 0. Using binary means every stored value is represented by transistor states, which can be read and written billions of times per second with extremely high reliability. Building hardware for ten distinct voltage levels (decimal) would be far less reliable.