Why Computers Use Binary

At the core of every processor and memory chip are billions of tiny transistors. Each one has exactly two stable states: conducting current (1) or not conducting (0). There's no "sort of conducting" in digital logic - it's one or the other. Because of that physical reality, binary is the natural language for hardware. It's not a design choice someone made arbitrarily; it's what the physics gives you.

Each binary digit is called a bit. Eight bits make a byte, which is the unit you see when checking file sizes or RAM capacity. A single byte can hold values from 0 (00000000 in binary) all the way up to 255 (11111111 in binary), giving 256 distinct states.

Decimal column weights: … 1,000 · 100 · 10 · 1
Binary column weights: … 8 · 4 · 2 · 1

Binary 1101 = (1×8) + (1×4) + (0×2) + (1×1) = 8 + 4 + 0 + 1 = 13

The column weights in binary are consecutive powers of 2 (2⁰=1, 2¹=2, 2²=4, 2³=8, …), just like decimal uses consecutive powers of 10. Same logic, different base.

Converting Decimal to Binary: The Repeated Division Method

This one's straightforward once you do it a couple of times. Divide the number by 2, write down the remainder, then divide the result by 2 again. Keep going until you hit 0. Then collect the remainders from bottom to top - that's your binary number.

Convert 45 to binary:
45 ÷ 2 = 22 remainder 1
22 ÷ 2 = 11 remainder 0
11 ÷ 2 = 5 remainder 1
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1

Read remainders bottom to top: 101101
Verify: 32 + 0 + 8 + 4 + 0 + 1 = 45 ✓

A quick sanity check: if the original number is odd, the rightmost binary digit will always be 1. If it's even, it'll always be 0. That alone can catch a lot of mistakes.

Reading Binary: Converting Back to Decimal

Going the other way is actually easier. Write out the column weights from right to left, then add up the weights wherever a 1 appears. Columns with a 0 contribute nothing, so you just skip them.

Convert binary 110010 to decimal:

Position: 5 4 3 2 1 0
Weight: 32 16 8 4 2 1
Digit: 1 1 0 0 1 0

Active columns: 32 + 16 + 2 = 50

If you know the powers of 2 up to at least 2¹⁰ = 1024 by heart, this becomes pretty quick. The sequence to memorize: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024.

Hexadecimal: A Much Shorter Way to Write Binary

Binary strings get unwieldy fast. A 32-bit memory address written out in full binary is 32 characters long - hard to read, easy to mistype, and nobody's idea of fun. Hexadecimal, base 16, fixes this neatly. Every group of exactly 4 binary digits maps to one hex digit, which compresses the whole thing by a factor of four.

Hex needs 16 symbols, but we only have 10 digits (0 - 9), so the letters A through F fill in for values 10 through 15:

Decimal101112131415
HexABCDEF
Convert binary 10110100 to hex:
Split into 4-bit groups: 1011 | 0100
1011 = 11 = B
0100 = 4
Result: B4

Verify: B4 in decimal = (11 × 16) + 4 = 176 + 4 = 180
Binary check: 128 + 32 + 16 + 4 = 180 ✓

Web color codes like #3A9FCC are just three hex bytes - one each for red, green, and blue intensity, running from 0 to 255. The # or 0x prefix is just a signal that what follows is hex, not decimal.

Octal: Mostly Obsolete, Except for Unix Permissions

Octal, base 8, uses digits 0 through 7 and each column is a power of 8. It's largely fallen out of general use as hex took over, but it survives in one very practical place: Unix and Linux file permissions.

Octal 74 = (7 × 8) + (4 × 1) = 56 + 4 = 60 in decimal

In Unix permissions, three groups of three bits describe access for the owner, group, and others - read, write, and execute. Each 3-bit group maxes out at 7 (binary 111 = rwx), which maps perfectly to a single octal digit. So chmod 755 breaks down like this:

Owner: 7 = 111 = rwx (full access)
Group: 5 = 101 = r-x (read and execute, no write)
Others: 5 = 101 = r-x (read and execute, no write)

That 3-bit-to-1-octal-digit fit is exactly why octal stuck around for this task. Three bits divide evenly into one octal digit. Three bits don't divide evenly into hex digits. So octal was simply the right tool here.

Quick Conversion Reference

DecimalBinaryOctalHex
0000000
4010044
81000108
10101012A
15111117F
16100002010
64100000010040
1281000000020080
25511111111377FF

FF in hex, 255 in decimal, 11111111 in binary - three different ways to write the same number. FF is the largest value a single byte can hold, with all 8 bits set to 1. That's a number worth recognizing on sight. Use the CalcSolver Pro base converter to convert any number instantly between all four systems.