Logo
READLEARNKNOWCONNECT
Back to posts
the-little-squares-are-just-math

The Little Squares Are Just Math

ChriseApril 02, 2026 at 2 PM WAT

How Do QR Codes Actually Work?

Here's how a pattern of black and white boxes tells your phone exactly where to go.

You scan them for menus, tickets, payments, Wi-Fi logins. They're everywhere. But those little black and white squares aren't random. They're a very specific kind of puzzle designed to be read fast, even if they're dirty, torn, or slightly crooked.

A QR code is just a grid of tiny squares. Black means 1. White means 0. That's binary, the language computers speak. String enough of those together and you can encode a URL, a phone number, a Wi-Fi password, or even a full paragraph of text. But the genius is in how it's organized.

The Three Big Squares

Look at any QR code and you'll see three identical squares in the corners. Those are position markers. They tell your phone's camera which way is up. No matter how you hold the code, the phone can figure out the orientation. The smaller square near the fourth corner is the alignment marker. It helps the phone correct for distortion if the code is printed on a curved surface or scanned at an angle.

Error Correction

This is the part that feels like magic. QR codes are built with redundancy. Even if a chunk is blocked by a logo, smudged with dirt, or physically torn, the code still works. The design includes extra data that acts like a backup. Up to 30% of the code can be damaged before it becomes unreadable. That's why you see brands putting their logos right in the middle.

Timing and Version

Between the big squares, there are alternating black and white cells forming a kind of ruler. That's the timing pattern. It tells the phone how big each individual square is supposed to be. The area near the bottom right corner stores version information, like which of the 40 possible QR code sizes you're looking at. Larger versions have more rows and columns, which means they can store more information.

What They Can Hold

A standard QR code can hold up to 3,000 characters. That's about 500 English words. Enough for a full page of text. But most of the time, it just holds a URL that points somewhere else. That keeps the code small and fast to scan.

QR codes were invented in 1994 by a Japanese company called Denso Wave to track car parts. They weren't meant for consumers, but they were designed to scan fast and survive factory conditions. That same durability made them perfect for the smartphone era. And the inventor, Masahiro Hara, decided not to enforce the patent. That's why they're everywhere. Awesome guy.

Tags

#explainers#masahiro-hara#qr-codes#tech-basics#very-decoded

Join the Discussion

Enjoyed this? Ask questions, share your take (hot, lukewarm, or undecided), or follow the thread with people in real time. The community’s open, join us.