What binary is and why you might need to convert it

Binary is a number system that uses only two digits: 0 and 1. Every number your computer stores, every color on your screen, every file you save — all of it is binary underneath. When you need to calculate binary, you are usually either converting a regular decimal number (the 0–9 system you use every day) into binary, or converting binary back into decimal so you can read it.

You do not need special software to do this. The math is straightforward enough to do by hand, and most calculators — including the one built into Windows, macOS, and Linux — have a binary mode. Understanding how the conversion works helps you read error codes, understand file permissions, and follow along when someone explains how computers actually store information.

Key Takeaways

  • Binary uses only 0 and 1, where each position represents a power of 2 (1, 2, 4, 8, 16, and so on), not a power of 10 like decimal does.
  • To convert decimal to binary by hand, divide the number by 2 repeatedly and write down the remainders in reverse order.
  • To convert binary to decimal by hand, multiply each digit by its position value (1, 2, 4, 8, 16) and add the results.
  • Your computer's built-in calculator has a binary mode that does the conversion when ready — Windows Calculator, Mac Calculator, and Linux Calculator all include it.
  • Binary is base-2 math, so each position to the left is worth twice as much as the position to its right.

Understanding place value in binary

In the decimal system you use every day, each position represents a power of 10. The rightmost digit is the ones place (100), the next is the tens place (101), then hundreds (102), and so on. In binary, each position represents a power of 2 instead.

The rightmost digit in binary is the ones place (20 = 1). Moving left, the next position is worth 2 (21), then 4 (22), then 8 (23), then 16 (24), and the pattern continues doubling. So the binary number 10110 means: one 16, zero 8s, one 4, one 2, and zero 1s. That adds up to 16 + 4 + 2 = 22 in decimal.

This is the foundation of all binary math. Once you see that each position is just a power of 2, converting between systems becomes a matter of addition or division.

Converting decimal to binary by hand

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

Here is the process for the decimal number 13:

  1. 13 ÷ 2 = 6 remainder 1
  2. 6 ÷ 2 = 3 remainder 0
  3. 3 ÷ 2 = 1 remainder 1
  4. 1 ÷ 2 = 0 remainder 1

Read the remainders from bottom to top: 1101. So 13 in decimal is 1101 in binary. You can check this: 1101 means one 8, one 4, zero 2s, and one 1, which is 8 + 4 + 1 = 13. It works.

For larger numbers, the process is the same — just more steps. The decimal number 255 becomes 11111111 in binary (eight 1s in a row). The decimal number 256 becomes 100000000 (a 1 followed by eight 0s).

Converting binary to decimal by hand

To convert binary to decimal, write the place values above each digit (1, 2, 4, 8, 16, and so on, doubling each time). Multiply each binary digit by its place value, then add all the results together.

Here is the process for the binary number 10101:

Binary digit10101
Place value168421
Multiply1 × 16 = 160 × 8 = 01 × 4 = 40 × 2 = 01 × 1 = 1

Add them up: 16 + 0 + 4 + 0 + 1 = 21. So 10101 in binary is 21 in decimal. Notice that you only add the place values where the binary digit is 1 — the 0s contribute nothing, so you can skip them.

Using your computer's calculator for binary

If you do not want to do the math by hand, every major operating system includes a calculator with binary mode built in.

Windows: Open the Calculator app (search for "Calculator" in the Start menu). Click the menu icon (three horizontal lines) in the top left, then select "Programmer". You will see a row of buttons labeled "Dec", "Hex", "Oct", and "Bin". Click "Bin" to switch to binary mode. Type a decimal number and the calculator shows the binary equivalent when ready. Click "Dec" to switch back.

macOS: Open Calculator (in Applications > Utilities). Go to View menu and select "Programmer". You will see the same mode buttons. Click "2" (for base-2, which is binary) to switch modes. Type a number and it converts automatically.

Linux: Open the Calculator app (the name varies by distribution, but it is usually called "Calculator" or "Gnome Calculator"). Look for a menu or settings option to switch to "Scientific" or "Programmer" mode, then find the binary button. The exact steps depend on your Linux version, but the principle is the same.

Why binary matters in real situations

You might encounter binary in file permissions on Linux or macOS systems. Permissions are often shown as three-digit numbers like 755 or 644, and each digit is actually a binary number in disguise. The number 7 in binary is 111, which means "read, write, and execute". The number 5 in binary is 101, which means "read and execute, but not write". Understanding this connection helps you understand what those numbers actually control.

Binary also shows up in network addresses (IP addresses use binary under the hood), in color codes (each color channel — red, green, blue — is stored as a number from 0 to 255, which is 00000000 to 11111111 in binary), and in error codes that computers display. When you see a number and wonder what it means, converting it to binary sometimes makes the pattern clear.

Common mistakes when calculating binary

The most common mistake is forgetting that binary only has two digits: 0 and 1. If you write a 2 or a 3 in a binary number, it is not binary anymore. Every digit must be either 0 or 1.

Another mistake is reversing the order when converting decimal to binary. When you divide by 2 repeatedly and collect remainders, you must read them from bottom to top, not top to bottom. Writing them in the wrong order gives you a completely different number.

A third mistake is losing track of place value. In binary, the rightmost digit is always worth 1, the next is always worth 2, then 4, then 8, and so on. If you assign the wrong place value to a digit, your conversion will be wrong. Writing the place values above the digits before you multiply helps prevent this.

Frequently Asked Questions

Can I convert really large numbers to binary by hand?

Yes, but it becomes tedious. The decimal number 1000 is 1111101000 in binary — ten digits. The process is the same (divide by 2 repeatedly), but you have more steps. For numbers larger than a few hundred, using a calculator is faster and less error-prone.

What is the difference between binary, hexadecimal, and octal?

They are all number systems with different bases. Binary is base-2 (two digits: 0 and 1). Octal is base-8 (eight digits: 0–7). Hexadecimal is base-16 (sixteen digits: 0–9 and A–F). Computers use all three, but binary is the most fundamental because it matches how computer hardware actually works.

Why do computers use binary instead of decimal?

Because binary is easier to represent with electricity. A wire is either on (1) or off (0). Decimal would require ten different voltage levels, which is harder to build reliably and more prone to errors. Binary's simplicity is why it became the standard.

Do I need to memorize powers of 2?

It helps to know the first few: 1, 2, 4, 8, 16, 32, 64, 128, 256. But you do not have to memorize them. You can always write them down or use a calculator. The pattern (each one is double the last) is more important than memorization.

What if I get a different answer when I convert back?

Check your place values first — make sure you assigned the right power of 2 to each digit. Then check your multiplication and addition. A common error is forgetting to include a place value in your sum, or multiplying a digit by the wrong place value. Working through it slowly a second time usually finds the mistake.