SecLern
Blog · Video lessons · 2 min

How a torn QR code still scans

How a torn QR code still scans

By The SecLern Team · Dec 4, 2026

Transcript

This QR code is missing a chunk. Someone tore the corner right off. Point a phone at it, and it still opens the page. So how does it read squares that aren't there? QR codes were invented in 1994, by a Japanese company called Denso Wave. QR stands for Quick Response. Ours is a grid of 25 by 25 squares, called modules. Black is a one, white is a zero. The three big squares in the corners are finder patterns. They show the camera where the code is, and which way is up. Now the message. Every eight modules make one byte, called a codeword. Our code holds 44 codewords. Sixteen are for the message, the address seclern.com. The other 28 are backup. But the backup is not a copy. It's maths, called Reed-Solomon codes, from 1960. Here's the idea. Two points pin down a straight line. So send four points on that line. Lose any two, and the two left still draw the same line. Reed-Solomon does this with a curve built from all 16 message bytes, plus 28 extra points on it. So the phone reads all 44 codewords. Our tear broke 13 of them. The maths works out which ones are wrong, and what they should have been. It can repair up to half the backup: 14 codewords. Thirteen is under the limit, so the page opens. There are two catches. Tear a bit more, and 19 codewords break. Over the limit, so nothing opens. And tear off a finder pattern, and most cameras can't even find the code. You pick the amount of backup when you make a code. Level L repairs about 7%, M about 15, Q about 25, and H about 30%. That's why some codes have a logo in the middle. It's planned damage, and the backup covers it. So remember it like this. A QR code carries extra maths, not extra copies. Lose up to 30% and keep the message. Want to practise this hands-on? Try it free at seclern.com, and follow for more.

The SecLern TeamSecLern builds practice questions, performance-based questions and browser-based hands-on labs for IT certifications.