← All guides

What a QR Code Actually Encodes (and Error Correction)

QR codes feel like magic: point a camera at a square of black-and-white noise and a website opens. But there is no magic, just a clever layout of data and deliberate redundancy. Understanding the two makes you better at creating codes that scan reliably, and explains why you can slap a logo in the middle of one and it still works.

It is mostly just text

At heart, a QR code stores a short string. Most often that string is a URL, which is why scanning one opens a page, but it can equally hold plain text, contact details, Wi-Fi login info or a payment reference. The camera app reads the string and decides what to do with it. You can prove this by generating a code from any text with a QR code generator and then reading it back with a QR to text scanner. What comes out is exactly what you put in.

The fixed patterns

Some parts of a QR code are not data at all. The three large squares in the corners are finder patterns that let a scanner locate and orient the code from any angle. Smaller alignment marks keep it readable when the surface is curved or the photo is skewed. The rest of the grid carries the actual content, encoded as light and dark modules.

Why damage does not break it

The key idea is error correction. A QR code does not store just your data; it stores extra redundant information calculated from that data. If part of the code is scratched, smudged or covered, the scanner uses the redundancy to reconstruct what is missing. This is the same family of maths that lets a scratched disc still play. It is also why a brand can drop a logo over the centre of a code: the covered modules are simply rebuilt.

A QR code trades space for resilience. The more redundancy you add, the more damage it survives, but the denser and busier the code becomes for the same content.

The four error-correction levels

You choose how much redundancy to include, from four levels:

LevelRecovers aboutUse when
L (Low)7%Clean digital display, short data
M (Medium)15%General-purpose default
Q (Quartile)25%Print that may get scuffed
H (High)30%Logo overlay, harsh conditions

Higher levels survive more damage but use more modules, so the pattern gets denser. If you want a logo in the middle, pick H so the covered area stays within what the code can recover.

Keep the content short

The more data you encode, the more modules the code needs, and the smaller each one becomes for a given size. Tiny modules demand a sharper camera and a larger print. That is the practical case for short URLs: less data means a cleaner, more forgiving code. When in doubt, shorten the link before you generate the code.

Frequently asked questions

What can a QR code store?

Usually a short piece of text such as a URL, but it can also hold plain text, contact details, Wi-Fi credentials or a payment string. Most QR codes you scan simply contain a link that the camera opens.

Why does a QR code still scan when it is damaged?

Because it stores extra redundant data using error correction. The code can rebuild the missing parts from this redundancy, so scratches, smudges or a logo over the centre do not stop it from being read.

What do the error-correction levels mean?

There are four levels, L, M, Q and H, recovering roughly 7, 15, 25 and 30 percent of the code. Higher levels survive more damage but pack the same data into denser patterns, so the code looks busier.

Does more data make a QR code harder to scan?

Yes. More data means more and smaller squares, which need a sharper camera and a larger print to scan reliably. Keeping the content short, such as using a shorter URL, makes a code easier to read.