Binary arithmetic works the same way as decimal math, just with only two digits

Binary is a number system that uses only 0 and 1 instead of the ten digits (0 through 9) you use every day. When you add, subtract, or convert between binary and decimal, you follow the same logic — you just have fewer digits to work with. A binary digit is called a bit, and eight bits together make a byte.

Computers use binary because electronic circuits can easily represent 0 (off) and 1 (on). Understanding how to work with binary helps you see how computers actually store and process information. You do not need special tools — just paper, a pencil, and the rules that follow.

Key Takeaways

  • Each position in a binary number represents a power of 2, starting from 2⁰ on the right, so the rightmost digit is worth 1, the next is worth 2, then 4, 8, 16, and so on.
  • To convert binary to decimal, multiply each bit by its position value and add the results together.
  • To convert decimal to binary, divide by 2 repeatedly and collect the remainders in reverse order.
  • Binary addition follows the same carry rules as decimal addition: when two 1s add up, you write 0 and carry 1 to the next column.
  • Binary subtraction uses borrowing just like decimal subtraction, but you borrow 2 instead of 10 when a column needs it.

Understanding place value in binary

In decimal, each column represents a power of 10. The rightmost column is 10⁰ (which equals 1), the next is 10¹ (which equals 10), then 10² (which equals 100), and so on. Binary works the same way, except each column represents a power of 2.

In binary, the rightmost column is 2⁰ (which equals 1), the next column to the left is 2¹ (which equals 2), then 2² (which equals 4), then 2³ (which equals 8), then 2⁴ (which equals 16), and the pattern continues. This is the foundation for all binary math. Once you know what each position is worth, you can convert between binary and decimal, and you can add and subtract.

For example, the binary number 1011 has a 1 in the 8s place, a 0 in the 4s place, a 1 in the 2s place, and a 1 in the 1s place. That means 1011 in binary equals 8 + 0 + 2 + 1 = 11 in decimal.

Converting binary to decimal

To convert a binary number to decimal, write down the value of each position (1, 2, 4, 8, 16, 32, and so on), then multiply each bit by its position value. Add all the results together.

Take the binary number 10110. Starting from the right, the positions are worth 1, 2, 4, 8, and 16. The bits are 0, 1, 1, 0, and 1 (reading right to left). So you calculate: (0 × 1) + (1 × 2) + (1 × 4) + (0 × 8) + (1 × 16) = 0 + 2 + 4 + 0 + 16 = 22 in decimal.

Another example: binary 11001. The positions from right to left are 1, 2, 4, 8, 16. The bits are 1, 0, 0, 1, 1. So: (1 × 1) + (0 × 2) + (0 × 4) + (1 × 8) + (1 × 16) = 1 + 0 + 0 + 8 + 16 = 25 in decimal. Every bit that is 0 contributes nothing, so you only add the positions where the bit is 1.

Converting decimal to binary

To convert a decimal number to binary, divide the number by 2 and write down the remainder. Then divide the result by 2 again and write down the remainder. Keep going until you reach 0. The remainders, read from bottom to top, are your binary number.

Let's convert 13 to binary. Divide 13 by 2: you get 6 with remainder 1. Divide 6 by 2: you get 3 with remainder 0. Divide 3 by 2: you get 1 with remainder 1. Divide 1 by 2: you get 0 with remainder 1. Read the remainders from bottom to top: 1101. So 13 in decimal is 1101 in binary. You can check this: 1 × 8 + 1 × 4 + 0 × 2 + 1 × 1 = 13. Correct.

Another example: convert 25 to binary. 25 ÷ 2 = 12 remainder 1. 12 ÷ 2 = 6 remainder 0. 6 ÷ 2 = 3 remainder 0. 3 ÷ 2 = 1 remainder 1. 1 ÷ 2 = 0 remainder 1. Read from bottom to top: 11001. Check: 1 × 16 + 1 × 8 + 0 × 4 + 0 × 2 + 1 × 1 = 25. Correct.

Adding binary numbers

Binary addition follows the same rules as decimal addition. You add column by column from right to left. When the sum in a column is 2 or more, you write down the remainder and carry 1 to the next column.

The four rules for binary addition are: 0 + 0 = 0; 0 + 1 = 1; 1 + 0 = 1; and 1 + 1 = 10 (which means write 0 and carry 1). When you have 1 + 1 + 1 (including a carry from the previous column), the result is 11 in binary, which means write 1 and carry 1.

Example: add 1011 + 0110. Start on the right: 1 + 0 = 1. Next column: 1 + 1 = 10, so write 0 and carry 1. Next column: 0 + 1 + 1 (the carry) = 10, so write 0 and carry 1. Next column: 1 + 0 + 1 (the carry) = 10, so write 10. The answer is 10001. Check: 1011 is 11 in decimal, 0110 is 6 in decimal, 11 + 6 = 17, and 10001 is 17 in decimal. Correct.

Subtracting binary numbers

Binary subtraction also works like decimal subtraction. You subtract column by column from right to left. When the bottom digit is larger than the top digit, you borrow 1 from the next column to the left. That 1 is worth 2 in the current column (because each position is worth twice as much as the one to its right).

The four rules for binary subtraction are: 0 − 0 = 0; 1 − 0 = 1; 1 − 1 = 0; and 0 − 1 requires borrowing. When you borrow, the 0 becomes 2 (in binary terms), so 2 − 1 = 1, and the next column decreases by 1.

Example: subtract 0110 from 1011. Start on the right: 1 − 0 = 1. Next column: 1 − 1 = 0. Next column: 0 − 1 requires borrowing. Borrow 1 from the leftmost column, so the 0 becomes 2 and 2 − 1 = 1. The leftmost column becomes 1 − 1 = 0. The answer is 0101. Check: 1011 is 11 in decimal, 0110 is 6 in decimal, 11 − 6 = 5, and 0101 is 5 in decimal. Correct.

Frequently Asked Questions

Why do computers use binary instead of decimal?

Electronic circuits have two stable states: on and off. Binary's two digits (0 and 1) map directly to these states, making it straightforward and reliable for computers to store and process data. Decimal would require circuits to distinguish between ten different voltage levels, which is much harder to do accurately.

What is the largest number I can represent with 8 bits?

With 8 bits, the largest number is 11111111 in binary, which equals 255 in decimal. This is because 2⁷ + 2⁶ + 2⁵ + 2⁴ + 2³ + 2² + 2¹ + 2⁰ = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. This is why a single byte can hold values from 0 to 255.

Do I need to memorize the powers of 2?

It helps to know the first several: 1, 2, 4, 8, 16, 32, 64, 128, 256. But you can always calculate them by doubling the previous number. You do not need to memorize them to do binary math — you just need to know the rule that each position is worth twice the one to its right.

What is the difference between binary and hexadecimal?

Hexadecimal uses 16 digits (0 through 9, then A through F) instead of 2. It is often used in computing because it is more compact than binary — one hexadecimal digit represents four binary digits. But the conversion process is similar: each position represents a power of 16 instead of a power of 2.