Tech

Binary Calculator: Understanding How Computers Think

10 April 2026Sarah HollowayShare2 min read

Part of Internet Speed, File Sizes & Digital Storage.

Binary Calculator: Understanding How Computers Think

My understanding of how computers actually process information improved considerably once I took the time to understand binary properly rather than accepting it as a mysterious abstraction.

At the most fundamental level, every computer, smartphone, and digital device operates using binary — a number system with just two digits: 0 and 1. Understanding it makes the logic of computing significantly clearer, and makes topics like file sizes, colours, network addresses, and permissions genuinely comprehensible rather than mysterious.

Why Binary?

Computers are built from billions of electronic switches (transistors). Each switch has two states: on or off, high voltage or low voltage. This maps perfectly to binary — on = 1, off = 0. Building reliable circuits for a 10-state system (as decimal would require) is vastly more complex. Binary is the natural language of digital electronics, and everything else is built on top of it.

Our Base64 encoder is one practical application of representing binary data in text form. Our URL encoder similarly handles text-binary representation for web contexts.

How Binary Counting Works

In decimal, each digit position represents a power of 10: 345 = (3×100) + (4×10) + (5×1). Binary works identically but with powers of 2. Binary 1011 = (1×8) + (0×4) + (1×2) + (1×1) = 11 in decimal.

Binary positions from right: 1, 2, 4, 8, 16, 32, 64, 128... Each position doubles.

Converting Decimal to Binary

Repeatedly divide by 2 and record remainders; read them bottom-to-top. Convert 13: 13÷2=6 r1 | 6÷2=3 r0 | 3÷2=1 r1 | 1÷2=0 r1. Bottom to top: 1101. Check: 8+4+0+1 = 13 ✓

Bits and Bytes

A bit is one binary digit. A byte is 8 bits, representing 256 possible values (2⁸). One byte encodes one ASCII character. The storage hierarchy: 8 bits = 1 byte | 1,000 bytes = 1 KB | 1,000 KB = 1 MB | 1,000 MB = 1 GB.

Hexadecimal: Binary's Shorthand

Hexadecimal (base-16, digits 0-9 and A-F) provides a compact human-readable form of binary. Each hex digit = exactly 4 bits. That's why colour codes (#FF5733), memory addresses, and file hashes are written in hex — far shorter than equivalent binary strings. 0xFF = 11111111 binary = 255 decimal.

Practical Appearances of Binary

  • IP addresses: IPv4 = 32 bits in four groups of 8 (understanding binary makes subnet masks clear)
  • File permissions (Unix/Linux): chmod 755 is octal — a compact binary representation of permission flags
  • Colour values: #RRGGBB — each pair is a byte (0-255) for red, green, blue
  • Network protocols: all packet headers, checksums, and addresses are binary at the hardware level

Further reading: BBC Bitesize covers binary and data representation for GCSE Computer Science. Learn binary at BBC Bitesize Computer Science.

Why Binary and Not Any Other Base

Electronic circuits operate at their most reliable when distinguishing between two states: voltage present (1) or voltage absent (0). A system requiring three or more states would need more precise voltage control, more complex circuitry, and would be more prone to errors from electrical noise. Binary aligns naturally with transistor-based electronics. Every modern processor contains billions of transistors, each acting as a binary switch. The simplicity of two states — on and off — is what makes the extraordinary complexity of modern computing possible.

Reading and Writing Binary Numbers

Each position in a binary number represents a power of 2, starting from the right at 2⁰ = 1. The positions going left represent 2¹ = 2, 2² = 4, 2³ = 8, 2⁴ = 16, and so on. To convert 1011 in binary to decimal: (1 × 8) + (0 × 4) + (1 × 2) + (1 × 1) = 8 + 0 + 2 + 1 = 11. To convert decimal to binary, repeatedly divide by 2 and track the remainders: 11 ÷ 2 = 5 remainder 1; 5 ÷ 2 = 2 remainder 1; 2 ÷ 2 = 1 remainder 0; 1 ÷ 2 = 0 remainder 1. Reading the remainders from bottom to top: 1011.

How Binary Relates to Computer Storage

One binary digit is one bit. Eight bits make one byte. One kilobyte is 1,024 bytes (2¹⁰). One megabyte is 1,024 kilobytes. One gigabyte is 1,024 megabytes. This base-2 scaling explains why storage capacities are never exactly round numbers in the decimal sense. A file described as "1 MB" by an operating system occupies 1,048,576 bytes — slightly more than a million. Storage manufacturers typically use decimal definitions (1 MB = 1,000,000 bytes), which is why a drive advertised as 1TB shows as 931 GB when connected to a computer.

Hexadecimal: Binary in a More Readable Form

Programmers rarely write raw binary because long strings of 1s and 0s are difficult to read. Hexadecimal (base 16) uses digits 0–9 and letters A–F to represent values 0–15. Each hexadecimal digit represents exactly four binary digits (one nibble). The binary value 11110101 becomes F5 in hexadecimal — shorter and more readable, while still mapping directly to a binary representation. Hexadecimal appears in colour codes (#FF5733), memory addresses, and file-level data representations throughout computing.

#Maths

Put the ideas in this article into numbers with these free tools.