Why can a QR code still be read when it's a bit dirty?

The secret is some hidden backup data written into the code.Because QR codes have a built-in system called "error correction" that can restore data even when part of it can't be read. Extra backup data for repairs is added to the original data, so the code can still be read when it is dirty or damaged. You can choose from 4 levels of correction, and the strongest level can restore about 30%.


Backup data repairs missing parts
According to DENSO WAVE, the company that created the QR code, QR codes have an "error correction" ability that can restore the data even if the code gets dirty or damaged. This works by adding backup data called a "Reed-Solomon code" to the original data. When part of the code can't be read, the reader uses the backup data to calculate and fill in the missing parts.
Fixing needs twice as much backup
To fix data, you need twice as much backup data as the amount you want to be able to fix. For example, to be able to fix 50 out of 100 pieces of original data, you need 100 pieces of backup data. That makes 200 pieces in total, of which 50 can be fixed, which is 25% of the whole. Here, one "piece" is a unit of data made of 8 bits.
4 levels to choose from
The strength of error correction can be chosen from 4 levels: L, M, Q and H. They can restore about 7%, about 15%, about 25% and about 30%, respectively. But the higher the level, the more backup data is needed, and the bigger the code becomes. Q or H is chosen for factories where codes get dirty, L for clean places when lots of data must fit, and M is the most commonly chosen level.

- 1A code with dirt and scratches
- 2The original data
- 3Spare data for fixing errors
- 4The reader
- 5The restored data

Square marks show the direction
QR codes also contain big square marks called position detection patterns. Their black and white widths follow the ratio 1:1:3:1:1, which was chosen after studying huge amounts of printed matter, such as fliers and cardboard boxes, as the ratio that appears least often. By looking for these marks, a reader can quickly tell where the code is and which way it faces. That is why it can be read from any direction.
Want to know more?
- The Reed-Solomon code is a method of calculation also used in music CDs. It was first developed to deal with noise in communications with satellites and planetary probes.
- The QR code was announced in 1994. "QR" stands for "Quick Response," a name chosen because the goal was fast reading.
- DENSO WAVE holds the patent but declared that it would not use those rights. That is why anyone can use QR codes freely.

Quick quiz: test yourself
Remember what you just read? Give it a try!Why can a dirty QR code still be read?
Show the answer
- Backup data can repair it
- The ink repels dirt
- The phone remembers the picture
Backup data can repair it Backup data for repairs is added to the original data, so even if part of the code can't be read, it can be restored by calculation.
Backup data for repairs is added to the original data, so even if part of the code can't be read, it can be restored by calculation.
Next quiz ›Sources
- Error correction featureDENSO WAVE(QRcode.com)
- History of QR CodeDENSO WAVE(QRcode.com)
- Information capacity and versions of QR CodeDENSO WAVE(QRcode.com)
This article was written after checking the sources above as of 2026-10-03. Explanations may change as research progresses. Photo credits are shown below each photo.
Next fun fact ▶
TechnologyHow does noise cancelling make sound disappear?When you turn on noise cancelling, the sound of the train seems to fade far away. Where does that sound go?
40 surprising animal facts with big photos and short, easy text. A fun-facts book for kids and grown-ups to read together.
See it on Amazon

