How QR Codes Actually Work

There's a lot going on inside that little grid of squares. Shri Khalpada at PerThirtySix built one of the best explainers we've seen on how QR codes actually work. Interactive, fun, and way more fascinating than you'd expect.

How QR Codes Actually Work

They're on restaurant menus, product packaging, business cards and billboards. QR code usage grew over 300% between 2021 and 2025, and roughly 100 million Americans are now scanning them every month. Most of us point and scan without a second thought.

But there's a lot going on inside that little grid of squares. We came across a great interactive breakdown that explains the whole thing clearly, and wanted to share the highlights.

The basics:

  • Your camera reads the grid as a pattern of ones and zeros. Black square on, white square off. That stream of data decodes into whatever was encoded, a URL, a payment prompt, a block of text
  • The codes come in different sizes depending on how much data they need to store. More data means a bigger, denser grid
  • Data is read in a zigzag pattern across the grid, which helps the scanner stay accurate even at an angle

The structural pieces:

  • Corner squares act as anchors so your phone can locate and orient the code instantly, even upside down
  • Timing patterns run through the grid to help the scanner measure each square accurately
  • Alignment markers scattered across larger codes help correct for distortion on curved or angled surfaces

The clever parts:

  • Error correction rebuilds missing data mathematically, even if part of the code is torn, dirty or covered. Same concept used in CDs. Up to 30% of a QR code can be damaged and it will still scan. That's why logos in the middle of QR codes actually work
  • Mask patterns do a final scramble of the grid before the code is locked in, to avoid visual patterns that would confuse a scanner

The full article has live interactive demos where you can type your own text and watch a QR code build itself in real time. Worth a look.

How The Heck Do QR Codes Work? (An Interactive Exploration)
An interactive exploration of how QR codes work: from binary encoding and error correction to the clever geometry that makes them scannable.