Decoding a QR code means turning the black and white squares back into the message: a link, a WiFi login, some text. A scanner does it in a split second. This guide shows the fast way first, then how the pattern really works, so you know what a scanner is looking at and why some codes fail.
The fast way: let a reader do it
- Code on paper or another screen: point your phone camera at it.
- Code in a picture or screenshot: drop it in our QR decoder for images. It shows the raw content as text, without opening anything.
- Code you do not trust: use the safe QR code scanner, which checks the link for warning signs.
- WiFi code: the WiFi QR decoder shows the network name and password.
What a QR code is made of
Every QR code has the same fixed parts. A scanner finds these first, then reads the rest.
| Part | Where | What it does |
|---|---|---|
| Finder patterns | The 3 big squares in the corners | Tell the scanner where the code is and which way is up. The missing fourth corner gives the direction. |
| Quiet zone | Blank border around the code | Separates the code from the background. Too little border is a common reason codes fail. |
| Timing patterns | Dotted lines between the finder squares | Alternate dark and light so the scanner can count rows and columns. |
| Alignment pattern | Small square near the bottom right | Helps with bent or angled codes. Version 1 codes (21 x 21) have none. |
| Format information | Strips next to the finder squares | 15 bits: the error correction level, the mask number and a check. |
| Data and error correction | Everything else | Your message plus spare data to fix damage. |
How a scanner decodes it, step by step
- Find the three corner squares. Each has a 1:1:3:1:1 dark light ratio across it, which is rare in normal pictures, so it is easy to spot.
- Straighten the code using the corners and the alignment pattern, then lay a grid over it. Each cell becomes a 1 (dark) or 0 (light).
- Read the format bits. They say how strong the error correction is (L, M, Q or H) and which of 8 masks was used.
- Remove the mask. The mask flips some cells to avoid big blank or black areas. Flipping them back gives the real bits.
- Read the data in a zig zag, two columns at a time, starting at the bottom right and snaking up and down.
- Fix errors. Reed Solomon math uses the spare data to correct damaged cells. This is why a code with a logo or a scratch still works.
- Turn bits into the message. The first 4 bits say the mode (numbers, letters, bytes or kanji), the next bits say the length, then comes the content.
Can you decode a QR code by hand?
Yes, for a small code, if you are patient. Reading the format bits, removing the mask and following the zig zag on a 21 x 21 code takes maybe half an hour on graph paper. The part nobody does by hand is the error correction math. If the code is clean you can skip it and still read the message. It is a fun way to learn, but for real use a reader is quicker and does not make mistakes.
Why a QR code will not decode
Each step above can fail. Knowing which one helps you fix it:
- Corners not found: a corner square is cut off, covered or too close to the edge. Crop with more border.
- Grid wrong: the photo is at a steep angle, curved or blurry. Try the blurry QR code reader.
- Too much damage: more cells are broken than the error correction can fix. The QR code repair tool rebuilds the fixed parts and tries again.
- Low contrast: light colors on a light background. Dark on light works best, see can QR codes be colored.
- Decodes but shows nothing useful: the data is fine but your app does not know the format. See no usable data found.
More fixes are in our QR code not scanning guide, and the error correction levels guide explains L, M, Q and H in more detail.
Questions
Is decoding a QR code the same as scanning it? Almost. Scanning is the camera part, decoding is turning the pattern into text. A decoder for images skips the camera.
Can a QR code be encrypted? The pattern itself is not secret. Anyone can decode it. An app can put encrypted text inside, but then only that app can read the message.
Does decoding a code open the link? Not with our reader. It shows the content as text and you decide what to do with it.
To see how a particular code was built, with its version, error correction level, mask and quiet zone, run it through the QR code checker.
