QR Code Guides · 4 min read

How to Decode a QR Code (and How the Pattern Works)

By Zeeshan · Reviewed by Najeeb ur Rehman · November 7, 2026

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.

PartWhereWhat it does
Finder patternsThe 3 big squares in the cornersTell the scanner where the code is and which way is up. The missing fourth corner gives the direction.
Quiet zoneBlank border around the codeSeparates the code from the background. Too little border is a common reason codes fail.
Timing patternsDotted lines between the finder squaresAlternate dark and light so the scanner can count rows and columns.
Alignment patternSmall square near the bottom rightHelps with bent or angled codes. Version 1 codes (21 x 21) have none.
Format informationStrips next to the finder squares15 bits: the error correction level, the mask number and a check.
Data and error correctionEverything elseYour message plus spare data to fix damage.

How a scanner decodes it, step by step

  1. 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.
  2. 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).
  3. Read the format bits. They say how strong the error correction is (L, M, Q or H) and which of 8 masks was used.
  4. Remove the mask. The mask flips some cells to avoid big blank or black areas. Flipping them back gives the real bits.
  5. Read the data in a zig zag, two columns at a time, starting at the bottom right and snaking up and down.
  6. 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.
  7. 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.

Related guides

How to Scan a QR Code From a Screenshot (iPhone, Android, PC) Scan a QR code from a screenshot without a second phone. Steps for iPhone Photos, Android… QR Code to Link: Get the URL Out of a QR Code Image Turn a QR code image or screenshot into a link you can copy and check before… How to Translate a QR Code in Another Language Scanned a QR code in a language you cannot read? Translate the page or the text…
About Toolsque
Every tool and guide here is built and tested by hand. QR codes follow ISO/IEC 18004 and barcodes follow the GS1 rules, and every reader is tested with real images and a real scanner before release. Read how we build and test.