QR code grid pattern: why it looks that way and why it scans

PublishedToolURL (Link) QR Generator

Contents
  1. Why does a QR code have this grid pattern?
  2. How to check: why it still scans when covered or colored
  3. Common sticking points
  4. The bottom line
  5. FAQ

You've probably tapped your phone's camera on a QR code and watched it scan instantly, but wondered why the black-and-white pattern inside looks the way it does. In fact, every part of the pattern has a job, and it's no accident that a QR code still scans when part of it is covered or colored. Once you understand how it works, you can judge for yourself how far you can push the colors and design when you make your own QR code.

Summary ① A QR code represents data by arranging dark and light squares (modules), and the square shapes in three corners are finder patterns that let a scanner lock onto the code's position and orientation ② A QR code still scans when part is covered or colored because Reed–Solomon error correction can restore damaged data ③ A higher error correction level means the code scans even when more of it is covered, but for the same information the grid becomes that much denser

Why does a QR code have this grid pattern?

At a glance the black-and-white squares look random, but a QR code is a grid that encodes binary data by arranging dark and light squares according to fixed rules. The URL or text it actually holds is encoded in the light-and-dark combinations of those squares.

Look closely and you'll see a square-inside-a-square pattern in only three corners: top left, top right, and bottom left. These are finder patterns, and they act as reference points that let a scanner first locate the QR code and determine its position and rotation within a photo.

The dotted line running between the finder patterns (the timing pattern) helps the scanner calculate the size of one square, and the white margin outside the code (the quiet zone) gives it a reference for separating the code from the background. This structure is what lets a scanner redraw the grid accurately even when the camera angle or distance changes.

How to check: why it still scans when covered or colored

Alongside the actual data, a QR code stores extra information called error correction codewords. This uses Reed–Solomon coding, which lets the remaining information reconstruct the original values even if part of the source data is covered or damaged.

There are four error correction levels — L, M, Q, and H — which tolerate roughly 7%, 15%, 25%, and 30% damage respectively. That's the margin that lets a code with a logo in the middle, or with added color, still scan: the loss falls within this budget.

This recovery only works when the scanner can tell which areas are dark and which are light. If the contrast between foreground and background is too low, the scanner can't read the grid at all, regardless of error correction — so the surest test is to print the code at its actual size and scan it yourself under different lighting before you commit to the colors.

Check it with our tool. Just enter a URL, and you can change the foreground and background colors and see the result right away, then save a combination that scans cleanly as a PNG.

URL (Link) QR Generator

Free · no sign-up · create a colored QR right in your browser

Common sticking points

SituationCause
Changed the foreground to a light color and it won't readContrast itself is too low, so the scanner can't distinguish the grid — unrelated to error correction
Added a large logo in the middle and it won't readThe covered area exceeds the error correction limit (about 15% at level M)
It still scans when the code is photographed at an angleThe three corner finder patterns let the scanner correct for rotation and tilt
Recognition got worse after shrinking the margin too muchNot enough white margin (quiet zone) outside the code, so the scanner can't find the boundary

As the table shows, most scan failures come down to one of two things: not enough contrast, or going past the error correction limit. Even if you change the colors, you'll be fine as long as you stay within those two limits.

The bottom line

A QR code's black-and-white pattern is made up of a grid that carries the data, plus the finder and timing patterns that locate it. It still scans when part is covered or colored because Reed–Solomon error correction restores the lost information.

When you add color, the key is to keep enough contrast so you stay within the error correction budget. Keep the foreground dark and the background light, and most color combinations will scan without trouble.

URL (Link) QR Generator

Free · no sign-up · create a colored QR right in your browser

FAQ

Can I put a logo in the middle of a QR code and still have it scan?

Yes, as long as the area the logo covers stays within the error correction limit. But if the logo is large or covers the finder patterns in the corners, recognition drops sharply, so it's safest to keep the logo small and in the center.

Can I change the foreground and background colors freely?

You can, but the brightness difference between the two colors has to be large enough. Keep the foreground dark and the background light and most scanners will read it fine; if the two colors are similar in brightness, error correction won't recover it.

Is a higher error correction level always better?

It makes the code more resistant to coverage, but it also increases the number of grid squares needed to hold the same information, which makes the pattern denser and more complex. That helps when you're adding a logo or printing small, but if you're just carrying a link, the default level is enough.

This article was adapted from our Korean original. Read the Korean original

Related articles

  1. QR Error Correction Levels L, M, Q, H: What Each One MeansL, M, Q, and H recover about 7%, 15%, 25%, and 30% of a QR code. See why higher levels add cells and how a damaged code still reads.
  2. Random Number Picker Algorithm: Math.random vs CSPRNGHow Math.random, CSPRNG, and Fisher-Yates shuffling affect draw fairness, plus how to pick winners without bias.
  3. 301 vs 302 Redirects: Why a 301 Is Hard to Undo301 is permanent, 302 is temporary. How search engines and browsers treat each, why a wrong 301 is hard to undo, and how to check with curl.
  4. Resume photo URL not showing: how to check a direct image linkPasted a photo URL into Resume Builder but it won't show in the preview or PDF? Learn why page links fail and how to find the direct image link.
  5. robots.txt Disallow vs noindex: Why Blocked Pages Still ShowDisallow only blocks crawling, not indexing. So blocked URLs can still show up in search results without a snippet. Here's how noindex differs.
  6. Transparent PNG Signature: Draw on Canvas and SaveDraw your signature on a canvas and save it as a transparent PNG. How alpha channels work, and how image signatures differ from certified ones.

Related tools