QR Code Reader

Decode a QR code from an uploaded image or your camera, right in your browser — no app install, nothing uploaded to a server.

222 views

How a QR Code Is Actually Decoded

A QR (Quick Response) code is not a picture of data — it is a grid of black-and-white modules that directly encodes bits, and reading one back is a multi-step computer vision problem, not a simple lookup. The first step is locating the code at all: every QR code carries three distinctive finder patterns (the nested square rings in three corners), each with a very specific 1:1:3:1:1 dark-light module ratio along any scan line through their center. A decoder scans the image row by row hunting for that exact ratio, because it is statistically almost impossible to occur by accident in ordinary image content, which is precisely why it was chosen as the fingerprint. Finding all three finder patterns tells the decoder the code's rotation, scale, and rough position, even if the photo was taken at an angle.

Once oriented, the decoder samples the grid at each module's center to read it as a 1 or a 0, uses the format information strip next to the finder patterns to learn the error-correction level and masking pattern that was applied, reverses the XOR mask (QR codes deliberately scramble their own data with one of eight patterns to avoid long runs of identical modules, which would otherwise confuse the finder-pattern search), and finally runs Reed-Solomon error correction to reconstruct the original bytes — the same mathematical technique used on CDs and satellite links, which is why a QR code can still be read even when up to 30% of it is physically damaged or obscured, depending on the error-correction level chosen when it was generated.

This tool performs all of that decoding locally in JavaScript using an open-source QR decoding library, either on a still image you upload or on live video frames pulled from your device camera one at a time and analyzed the same way. Nothing is ever sent to a server — decoding a QR code that might contain a Wi-Fi password or personal contact details entirely in the browser, rather than uploading the image somewhere first, is a meaningful privacy difference.

What the Decoded Text Actually Means

  • A URL starting with http:// or https:// gets an "Open Link" button; anything else (plain text, a Wi-Fi credential string, a vCard) is shown as raw decoded text, since automatically acting on non-URL content would be unpredictable.
  • Camera scanning checks each frame roughly 60 times per second (matched to the browser's animation frame rate) until a valid code is found, then stops automatically - it never records or stores video.
  • A QR code with a higher error-correction level (denoted L/M/Q/H when it was created) tolerates more physical damage but stores less actual data per unit of code size, since more of the grid goes to redundancy instead of content.
  • If decoding fails on a photo, the most common causes are motion blur, extreme viewing angle, or a code so small in the frame that individual modules blur together - not a fundamentally unreadable code.

Frequently Asked Questions

How does the scanner find the QR code in a photo?

It searches for the three distinctive finder patterns - the nested square rings in three corners - by looking for their unique 1:1:3:1:1 dark-light ratio along scan lines. That ratio is extremely unlikely to appear by accident, which is exactly why it works as a reliable fingerprint even in cluttered photos.

Why can a damaged or partially covered QR code still be read?

QR codes use Reed-Solomon error correction, the same mathematical technique used on CDs and satellite transmissions, which stores redundant data alongside the actual content. Depending on the error-correction level chosen when the code was made, up to roughly 30% of the code can be missing or damaged and still decode correctly.

Is my photo or camera feed uploaded anywhere?

No. Both the uploaded-image path and the live camera path decode entirely in your browser using JavaScript - no image or video frame is ever sent to a server.

Why does the tool show an "Open Link" button for some codes but not others?

It only appears when the decoded text starts with http:// or https://. Other QR content - plain text, Wi-Fi credentials, contact cards - is shown as raw text instead, since automatically acting on non-URL data would not be predictable or safe.

Why did scanning fail even though there is clearly a QR code in the photo?

The most common causes are motion blur, a steep viewing angle that distorts the grid geometry, or the code being too small in the frame for individual modules to be distinguished - try a sharper, more head-on, closer photo rather than assuming the code itself is unreadable.

Comments

No comments yet — be the first to write one!

Similar Tools