Math

Binary to Decimal: What Binary Is and How to Convert It

Calcuonline · Updated · 5 min

A row of switches, some on and some off, joined by an arrow to a computer screen with colored bars

To convert binary to decimal, give each digit the value of its place, 1, 2, 4, 8, 16 and so on from the right, and add up the places that hold a 1: 1011 is 8 + 2 + 1 = 11. Binary is the base-2 number system computers use, with only two digits, 0 and 1. This guide explains what binary is, how to convert binary to decimal and decimal to binary by hand, and a doubling shortcut that skips the place values.

What is binary?

Binary is a number system in base 2: it writes every number with two digits, 0 and 1. Each digit is a bit, short for binary digit, which the National Institute of Standards and Technology defines as “a binary digit: 0 or 1”. Computers use binary because a bit maps onto anything with two states: a switch that is on or off, a voltage that is high or low.

Our everyday decimal system is base 10: in 365, the 3 is worth 3 hundreds, the 6 is 6 tens and the 5 is 5 ones. Binary works the same way, but each place is worth twice the place to its right instead of ten times. Counting places from 0 on the right:

Place Power of 2 Decimal value
0 20 1
1 21 2
2 22 4
3 23 8
4 24 16
5 25 32
6 26 64
7 27 128
8 28 256
9 29 512
10 210 1,024

How to convert binary to decimal

Write the place values over the digits, starting with 1 on the right, and add the values that sit over a 1. Take the binary number 110101:

Binary digit 1 1 0 1 0 1
Place value 32 16 8 4 2 1
Counts 32 16 0 4 0 1

32 + 16 + 4 + 1 = 53, so 110101 in binary is 53 in decimal. The zeros add nothing: they only hold the places of the ones.

A longer one, 10011100: the ones sit on the places worth 128, 16, 8 and 4, so it is 128 + 16 + 8 + 4 = 156.

The doubling shortcut

You can also read a binary number from left to right without writing any place values: start at 0, and for each digit double what you have and add the digit. For 110101:

Digit Double, then add Running total
1 0 × 2 + 1 1
1 1 × 2 + 1 3
0 3 × 2 + 0 6
1 6 × 2 + 1 13
0 13 × 2 + 0 26
1 26 × 2 + 1 53

The last total is the decimal number, 53, the same as with the place values. It is the quicker method for long binary numbers you would otherwise have to line up under 64, 128, 256 and beyond.

How to convert decimal to binary

Divide the number by 2, write down the remainder (0 or 1), and divide the quotient by 2 again until it reaches 0. The remainders, read from the bottom up, are the binary number. For 156:

Division Quotient Remainder
156 ÷ 2 78 0
78 ÷ 2 39 0
39 ÷ 2 19 1
19 ÷ 2 9 1
9 ÷ 2 4 1
4 ÷ 2 2 0
2 ÷ 2 1 0
1 ÷ 2 0 1

Read from the bottom up, the remainders give 10011100, the number from the section before.

For small numbers, subtracting powers of 2 is often faster: take the largest place value that fits, subtract it and repeat with what is left. For 53: 32 fits (21 left), then 16 (5 left), then 4 (1 left), then 1. Put a 1 on the places worth 32, 16, 4 and 1 and a 0 on the others: 110101.

Note: an even number always ends in 0 in binary and an odd number in 1, because the last place is the only one worth an odd amount. It is a quick check on any conversion: 53 is odd, so its binary form must end in 1.

Binary numbers from 0 to 15

Decimal Binary Hex
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F

Four bits cover 0 to 15, which is exactly one hexadecimal digit; the hex to decimal guide shows how programmers use that to write long binary numbers in short form.

Bits, bytes and binary in a computer

A byte is “a sequence of eight bits”, so it holds the numbers 0 to 255: 11111111 is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Text is stored the same way. In the ASCII code, the capital letter A is 1000001, which is 64 + 1 = 65, and a computer keeps it in a byte as 01000001.

Powers of 2 also explain why memory sizes look odd in decimal. 210 is 1,024, not 1,000, so NIST names the binary multiples apart from the decimal ones: a kibibyte (KiB) is 1,024 bytes, while a kilobyte (kB) is 1,000 bytes.

To check a conversion, enter your binary number in the binary calculator with a sum and 0 as the second number: it shows the result in binary, in decimal and in hexadecimal. It also adds, subtracts, multiplies and divides two binary numbers.

How to convert binary to decimal in 3 steps

  1. Write the place values over the digits from right to left: 1, 2, 4, 8, 16, 32, 64, 128.
  2. Add up the place values that sit over a 1; or, from the left, double your total and add each digit.
  3. Check the result with the binary calculator by adding 0 to your binary number.

Calculators in this article