How to Scan a Blurry or Tiny QR Code
A blurry QR code usually still holds all its data. The scanner just can't find the square corner markers or tell the dark modules from the light ones. Fix whichever of those is failing and most blurry codes read fine. The steps below go from the quickest fix to the last resort.
Why a QR code stops scanning
A QR code is a grid of small squares called modules. A reader has to do three things in order:
- Find the three corner squares (the finder patterns) to know where the code is and how it is turned.
- Pick a threshold that separates dark modules from light ones.
- Sample every module and rebuild the data, using error correction to repair up to 7 to 30% of damaged modules.
Blur hurts step 2 and 3: edges smear into gray, so neighboring modules bleed into each other. A code that is small in the frame fails at step 1 and 2, because each module may be only one or two pixels wide. Dim light and faded print shrink the gap between dark and light. A steep angle squeezes one side of the grid. Each of these has a different fix.
Quick fixes when scanning with a camera
- Step back a little. Phone cameras can't focus closer than about 10 cm. Moving back until the code is sharp beats holding it close and blurry.
- Tap the code on screen to make the camera focus on it, then hold still for a second.
- Add light, not glare. Turn toward a window or lamp, but tilt the code slightly so the light doesn't reflect straight back off glossy paper or a screen.
- Face the code straight on. A small tilt is fine; a steep angle can fail.
- Take a photo instead. A still photo is often sharper than live preview frames, and you can zoom in and crop it.
Reading a blurry QR code from a photo
Upload the photo to the QR code scanner for images. If the first read finds nothing, it runs a deep scan on your device before giving up. The deep scan prepares the image in several ways and reads it again after each one:
- Evening out the light by dividing each pixel by the brightness around it, which removes shadows and vignetting.
- Sharpening with an unsharp mask, which restores some edge contrast lost to focus blur.
- Enlarging the image or tiles of it, so a code that is only a few pixels per module gets bigger.
- Rotating by 45 degrees, which helps 1D barcodes printed at an angle.
- A different threshold method, which helps when a code sits on a busy or uneven background.
The decoder behind it is ZXing-C++, compiled to WebAssembly so it runs in the browser. It reads QR codes, Data Matrix, Aztec, PDF417 and 1D barcodes such as EAN, UPC and Code 128, and it tolerates perspective.
When the code is tiny in a big photo
A full-size phone photo is 12 megapixels or more. If the QR code covers a small patch of it, scaling the whole photo down to a workable size turns the code into a smudge. For that case the scanner offers an optional AI scan. A small neural network (OpenCV's WeChat QR detector, under 1 MB) marks where codes are in the photo, and each spot is cropped from the full-resolution image, enlarged and decoded.
The AI scan only runs if you ask for it. The first use downloads about 4 MB, saved in your browser for next time, and the page shows the size before downloading. You can delete the files from the same panel. The photo itself is never uploaded.
What we tested it on
We built 36 hard test images with 39 codes: blurred, motion-blurred, rotated, tilted, dark, faded, tiny and several codes per image. The results:
| Reader | Codes read |
|---|---|
| jsQR alone (the old fallback in browsers without a built-in detector) | 12 of 39 |
| Chrome on a Mac: its built-in detector plus jsQR | 32 of 39 |
| With the deep scan | 35 of 39 (34 in browsers without a built-in detector) |
| With the deep scan and the AI scan | 38 of 39 |
The one it never read was a Code 128 barcode smeared sideways by motion blur. Motion blur along the bars mixes neighboring bars together, and no sharpening brings that back.
When nothing works
- Use the original file. A screenshot of a compressed chat image has lost detail that a re-scan can't restore.
- Check that the whole code is in the picture, including the white border around it. A cut-off corner marker can't be recovered.
- Retake the photo with the steps above. A sharp photo always beats any repair.
If you made the code yourself and people struggle to scan it, the fix is upstream: print it bigger and use a higher error correction level. The QR code size guide covers the minimum print size for a given scanning distance.