What changes when a QR code becomes a JPG
A PNG writes each module as an exact colour value. A JPEG writes nothing of the kind: it splits the picture into 8 by 8 blocks, converts each block into frequency coefficients, then throws away the coefficients the encoder judges least visible. On a photograph that trade is invisible. On a code made entirely of hard edges, the discarded information is the edge itself.
Three behaviours that break QR codes
Chroma subsampling. Most encoders keep full brightness resolution and store colour at half or quarter resolution, the 4:2:0 and 4:2:2 modes. Brightness carries the shape of each module, so a well-tuned JPEG survives this. Push the quality down and the colour planes smear sideways into the neighbouring modules, which is what produces the faint coloured fringe you can see around a low quality code.
Ringing on hard edges. Quantizing a sudden jump from black to white overshoots on both sides and leaves faint concentric bands around every module. At quality 0.9 the bands sit a few grey levels above the background. At 0.5 they are wide enough that a decoder reads the first dark module of a row as two modules.
No transparency. JPEG cannot store an alpha channel, so the unpainted part of the image becomes a solid colour and the format has nowhere to record which one. That is why the background on this page is locked to white rather than offered as an option, and why a QR code JPG dropped on a dark web page still arrives with a white frame.
The number that decides whether it scans
Before any compression, divide the exported width by the total cell count. The total is the module count plus twice the quiet zone, so a version 3 code with a 4 module margin is 29 + 8 = 37 cells. At 900 pixels that is 24 pixels per module and compression has enormous room. At 111 pixels it is exactly 3, and quality below 0.85 starts to cost you scans. The readout under the preview shows this figure live.
- Under 2 pixels per module: decoders fail on screen, and fail consistently on camera.
- 3 to 4 pixels per module: works on screen and on a flatbed, risky on a phone camera.
- 5 to 8 pixels per module: scans from a printed page at arm's length.
- 10 pixels or more: safe for social media, where the platform recompresses your file again.
PNG, JPG, or SVG for a QR code image?
Pick PNG when the code will be resized, recoloured, or placed on a transparent background. Pick JPG when the destination only accepts photos, when the file travels through email, or when a page has a fixed white background anyway. Pick SVG when the code is going to print at an unknown size.
| Format | Lossy | Transparent | Best for | Main risk |
|---|---|---|---|---|
| PNG | No | Yes | Screens, app uploads, anything recoloured later | Largest file at big pixel dimensions |
| JPG / JPEG | Yes | No | Email signatures, web pages, forms that reject PNG | Soft module edges when quality drops |
| SVG | Vector, no loss | Yes | Print, embeds in HTML, logos | Many phone scanners will not open the file directly |
Settings that hold up
These are the combinations that survive the round trip from generator to camera, measured against the payload lengths most people paste in. They are starting points, not rules: raise the width if the preview reports fewer than 5 pixels per module.
| Where it goes | Width | Quality | Error level | Note |
|---|---|---|---|---|
| Link in an email footer | 600 px | 0.90 | M | Mail clients downscale images; keep some headroom |
| Website or landing page | 900 px | 0.92 | M | Sharp on retina, still under 10 KB for short payloads |
| Instagram or LinkedIn post | 1200 px | 0.95 | Q | Social platforms recompress once more on upload |
| Flyer, A5 at 300 dpi | 1500 px | 0.95 | M | Printed at about 4 cm with room to spare |
| Poster or banner | 2000 px | 1.00 | L | Viewed from distance, so large modules matter more than density |
| URL with a long query string | 1600 px | 0.95 | L | Long payloads force a higher version and smaller modules |
Print sizes at common resolutions
Print resolution is dots per inch, so divide the pixel width by the dpi to get the physical size. A 900 pixel QR code JPG prints at 3 inches across on a 300 dpi flyer, 6 inches on a 150 dpi poster, and 9 inches at the 100 dpi most large-format banner machines accept. Working backwards from the print is more useful: measure the space you have in inches, multiply by the dpi your printer uses, and export at that width or a little above it.
One caution for print work. Enlarging a JPEG that was exported small resamples an already lossy file, and the printer quantizes it a second time. Export at final size instead. If the code must scale beyond 2000 pixels, use the SVG route on the main QR code image generator.