QR Sample PNG: How to Export a High-Quality PNG QR Code

Bhargav Dhameliya
Bhargav Dhameliya
October 12, 2026
5 min read
qr sample png high quality png qr code featured

You exported a QR code as a PNG. It looked sharp on your screen. Then the printer enlarged it, a client pasted it onto a dark slide, or someone sent it through a chat app, and it stopped scanning.

Look, a PNG that looks sharp on your screen tells you nothing about whether a phone can read it. I build QR code tools, so I ran a test instead of guessing. This article gives you a QR sample PNG to download and check, then shows how to export a QR code as a PNG: how many pixels a PNG QR code needs, what DPI does (almost nothing), and which export habits quietly break a code.

The short answer: export at least 4 pixels per module, use whole-number multiples, keep the quiet zone, flatten transparency onto white, and use SVG when the code is going to print. The rest of this post is the evidence.
Question Answer from my test
Minimum pixels per module for a PNG? 4 passed both decoders. 2 passed only one.
Does a 300 DPI tag make a PNG sharper? No. It changes the printed size, not the pixels.
Does JPEG break a QR code? Not in my test. It made files up to 59 times bigger.
Is a transparent PNG safe? Only on a light page. On near-black it failed completely.
Best format for print? SVG. PNG is for screens, slides, email and web.

What Is a PNG QR Code?

A PNG QR code is a QR code saved as a PNG file. PNG (Portable Network Graphics) is a raster format, which means the image is a fixed grid of pixels. The W3C PNG specification describes it as a format for the “lossless” storage of raster images, so the pixels you export are the pixels you get back.

A QR code is itself a grid. Each small black or white square is a module. A module is the smallest unit of a QR code. When you export a PNG, you decide how many pixels draw each module. That one number decides almost everything that follows.

Here is the vocabulary I use in the rest of this post:

  • Quiet zone: the blank border around the code. The standard asks for 4 modules on every side. The QR code quiet zone entry explains why cropping it breaks scans.
  • Version: the size of the code in modules, from 21 × 21 (Version 1) up to 177 × 177 (Version 40). See QR code version.
  • Error correction level: how much damage a code can survive (L, M, Q or H). It adds modules, so it changes the grid size. See QR code error correction.
  • DPI: dots per inch, a print setting. In a PNG it is a label stored in the file, not extra detail.
  • Vector (SVG): a format that stores shapes instead of pixels, so it scales without softness.

One honest limit here: PNG is lossless, but lossless only protects what you exported. If the export is too small, PNG preserves the problem perfectly.

QR Sample PNG: Download One and Check It

If you searched for a QR sample PNG, you probably want a real file to test a scanner, a slide layout or a print workflow. Here is one. Right-click and save it.

QR sample PNG: a 1,184 by 1,184 pixel QR code exported at 32 pixels per module that scans to the linkutm QR code generator

This file is a real export, not a screenshot. Here are its specs, which you can confirm in your file viewer:

  • Size: 1,184 × 1,184 pixels
  • Pixels per module: 32 (a whole number)
  • Code: Version 3, error correction M, 29 × 29 modules plus a 4-module quiet zone
  • File size: 1,170 bytes
  • Content: https://linkutm.com/tools/qrcode-generator (a plain static link, no tracking)
  • DPI tag: 300, which makes it 100.2 mm wide in a design app that honours the tag

I decoded it with zxing-cpp before publishing, and it returned that exact URL. It is a static code, so the pattern holds the link itself. If you want other sample types, such as Wi-Fi, vCard or text, with their raw payloads, use the 12 samples in this QR code example guide. This post is about the file, not the content.

Limitation: a sample proves one export works. It does not prove yours will, because your link length changes the grid size and therefore the pixel math below.

How Many Pixels Does a High-Quality PNG QR Code Need?

At least 4 pixels per module. That was the first setting where both decoders in my test read every simulated phone capture. Google’s ML Kit documentation says “the smallest meaningful unit of the barcode should be at least 2 pixels wide,” and my results line up with that floor for one decoder and show it is optimistic for the other.

I exported the same Version 3 code at different sizes and ran 40 simulated camera captures per size. I used two open-source decoders: zxing-cpp (the ZXing port behind many Android scanner apps) and OpenCV’s QR detector.

The same QR code exported at 1, 2, 3, 4 and 8 pixels per module, with decode rates: zxing-cpp reads from 2 pixels, OpenCV needs 4
Pixels per module File size (px) zxing-cpp OpenCV
1 37 × 37 0% 0%
2 74 × 74 100% 0%
2.5 92 × 92 100% 7.5%
3 111 × 111 100% 85%
3.5 130 × 130 100% 85%
4 148 × 148 100% 100%
6 222 × 222 100% 100%
8 296 × 296 100% 100%

Two things stand out. First, the 1-pixel file decoded fine as a perfect digital image (both decoders read it), then scored 0 of 40 once a simulated camera touched it. A pixel-perfect file hides the problem until a real scan. Second, the decoders disagree. Phones use their own decoders (Apple Vision, Google ML Kit), so I treat 4 pixels per module as a safe target, not a guarantee.

Real files are bigger than they need to be anyway. A 300 px export of this code is 8 pixels per module. The trouble starts with thumbnails, favicons and small email images.

The formula to remember:

PNG width in pixels = pixels per module × (modules + 8)

The + 8 is the quiet zone, 4 modules on each side. A Version 3 code is 29 modules, so 4 pixels per module gives 4 × 37 = 148 pixels.

How Version, Modules, Pixels and DPI Connect in a PNG QR Code

Every number in a PNG export depends on the one before it. The guides I found for this topic mostly skip the chain, and it explains most “why won’t my code scan” problems.

  1. Your data length sets the QR code version. A longer URL needs a higher QR code version, which means more modules.
  2. Error correction adds modules. Higher levels (Q, H) can push a code up a version. They also let you survive damage, which is why a logo fits in the middle.
  3. Modules plus the quiet zone set the grid. A Version 3 code is 29 modules, so 37 across with its border.
  4. Pixels per module times the grid sets the file width. That is the formula above.
  5. File width divided by DPI sets the print size. 1,184 px at 300 DPI is 3.95 inches, or 100.2 mm.
  6. Print size divided by the grid sets the physical module size. That module size, plus how far away the phone is, decides whether a scan works. The scanning distance rule of 10:1 sits at the end of this chain.

So a longer URL does not only change the pattern. It shrinks every module at a fixed print size. That is the same reason short links print smaller, which I cover in the QR code smallest size guide.

Here is what the arithmetic gives for a Version 3 file (37 modules across) at 300 DPI:

Printed width Pixels at 300 DPI Pixels per module Module size
2 cm 236 6.4 0.54 mm
3 cm 354 9.6 0.81 mm
4 cm 472 12.8 1.08 mm
5 cm 591 16.0 1.35 mm
10 cm 1,181 31.9 2.70 mm

Every row clears the 4-pixel floor with room to spare. A Version 7 code (45 modules, 53 with the border) at 3 cm would get 6.7 pixels per module from the same 354 pixels. Dense codes are where small PNGs run out of margin first.

Limitation: this table assumes the file is placed at 100% and printed at 300 DPI. A print shop that resamples your file changes the numbers, which is why I ask for the vector file.

Why a DPI Setting Does Not Fix a Small PNG

A DPI tag changes the printed size of a PNG. It does not add detail. I saved the same 999-pixel code three times with different DPI tags and compared the files.

The same 999 pixel PNG QR code at 72, 96 and 300 DPI tags prints 352.4, 264.3 and 84.6 millimetres wide with identical pixels

The pixel dimensions stayed 999 × 999 and the file size stayed 1,075 bytes in all three. Only the print width changed: 352.4 mm at 72 DPI, 264.3 mm at 96 DPI and 84.6 mm at 300 DPI. The W3C PNG specification lists the physical-size chunk (pHYs) as the “intended pixel size and aspect ratio to be used in presenting the PNG image.” It is a hint to the software that places the file.

So “export at 300 DPI” is half advice. It matters if you then place the file at a fixed print size, because the pixels have to cover that size. What counts is the pixel width, not the label. A 150-pixel PNG tagged 300 DPI is still 150 pixels.

Why an Enlarged QR Code PNG Looks Soft

When a design tool enlarges a small PNG, it has to invent pixels, and the usual method (bilinear or bicubic interpolation) invents grey ones. A QR code needs hard black and white edges. Soft grey edges eat into the decoder’s margin.

To measure it, I took a 1-pixel-per-module PNG, enlarged it 8 times three ways, then photographed it with heavy simulated lens blur.

Enlarging a 1 pixel per module PNG QR code: nearest-neighbour keeps hard edges and decodes best, bilinear and bicubic blur them

Nearest-neighbour enlargement (copying each pixel into a block) kept edges hard. Under heavy blur at 1 pixel per module, zxing-cpp read 100% of nearest-neighbour captures, 88% of bicubic and 72.5% of bilinear. OpenCV read 62.5% of nearest and 0% of both smooth methods. At 2 to 4 pixels per module zxing-cpp barely noticed the method, while OpenCV still scored higher on nearest-neighbour in every case.

My rule: never enlarge a QR code PNG. Re-export it bigger from the generator. If you cannot, use the nearest-neighbour or “no smoothing” resampling option, or in CSS image-rendering: pixelated.

Limitation: heavy blur is a stress setting. In the clean case with no extra blur, every method decoded on zxing-cpp, and OpenCV dropped only on the 1-pixel file. The blur setting shows where the margin runs out, not what most scans look like. For the scanning-side causes of blur, see my blurry QR code fix guide.

Transparent PNG QR Codes: Where They Break

A transparent PNG has no background of its own. It borrows the page colour, and the scanner reads the result. A black-on-transparent code is a perfectly good file that becomes a bad code on the wrong page.

Transparent PNG QR code with black modules on white, grey, dark grey and near-black pages: it fails completely on near black

I composited the same black-module code onto five backgrounds and ran 40 simulated captures each.

Page colour behind the code zxing-cpp OpenCV
White #FFFFFF 100% 100%
Light grey #F2F2F2 100% 97.5%
Mid grey #808080 100% 100%
Dark grey #333333 70% 97.5%
Near black #111111 0% 0%

The near-black page failed on both decoders because black modules on a black page have almost no contrast. Flipping it, with light modules on a #111111 page, read in zxing-cpp but not in OpenCV. I would not ship an inverted code to anyone I cannot test with.

This matters for dark-mode slide decks, website footers and Notion pages that recolour the page behind your image. The fix is to flatten the PNG onto white before you send it. A transparent PNG is also bigger: at 1,200 pixels the RGBA version was 7,965 bytes against 1,701 bytes for a 1-bit PNG.

Limitation: contrast is the whole story here. If your brand uses a coloured code, check it on the real background. My guide to what stops a QR code from scanning covers how much contrast loss scanners tolerate.

PNG vs JPEG vs SVG for QR Codes

Use PNG for screens, SVG for print, and skip JPEG. A JPEG did not stop the code from scanning in my test. It just made the file much larger and softer.

I saved the same 1,200-pixel code in each format:

Format File size at 1,200 px
SVG (vector) 1,578 bytes
PNG, 1-bit black and white 1,701 bytes
PNG, 8-bit grey 3,641 bytes
PNG, 24-bit RGB 6,749 bytes
PNG, RGBA with transparency 7,965 bytes
JPEG, quality 95 101,085 bytes

The JPEG was 59 times the 1-bit PNG. At 4 pixels per module, a quality-95 JPEG was 8,127 bytes against 525 for the PNG, 15 times larger. Decoding held up. zxing-cpp read every JPEG from quality 95 down to quality 8 at 4 and 8 pixels per module. OpenCV read 95 to 100% of them, against 100% for the PNG, a gap of at most 2 captures out of 40. The only clear drop was quality 8 at 2 pixels per module, where zxing-cpp fell to 85%. Ten rounds of re-saving at quality 75 did not stop zxing-cpp from reading a 2- or 3-pixel code.

I still avoid JPEG for one reason: it is the wrong tool. It blurs the hard edges that scanners look for, it is larger, and the easy case I tested (pure black and white) is the one where JPEG does least harm. A logo or gradient makes it worse, and I did not test that.

SVG wins for print because it has no pixel grid to run out of. That is also the advice on linkutm’s tool pages: download the SVG for stickers, flyers and packaging, and keep the PNG for places that need a raster. The QR code sticker generator page makes the same call.

How to Export a High-Quality PNG QR Code

Follow these five steps and you will avoid every failure above.

  1. Pick the final size first. Decide the printed width in centimetres, or the on-screen width in pixels, before you touch the export button.
  2. Calculate the pixels you need. Use pixels per module × (modules + 8). Aim for 4 or more, and 8 or more for print. At 300 DPI, divide the printed width in centimetres by 2.54 and multiply by 300.
  3. Export in whole-number multiples. A file that is exactly 32 pixels per module keeps every module the same width. A non-integer size forces uneven 2 and 3 pixel modules.
  4. Keep the quiet zone and flatten transparency. Leave the 4-module border. Put the code on white unless you have tested the real background.
  5. Scan the exported file, not the preview. Open the PNG file itself, or the printed proof, with two or three phones at the distance a real person will stand.
linkutm’s free QR code generator downloads PNG, SVG and PDF with no account for static codes. The tool page describes a 1,200-pixel PNG for digital use. For a Version 3 code that is about 32 pixels per module, and at 300 DPI it covers a 10.2 cm print. For anything printed, take the SVG. If you want a code you can edit and count after printing, the same exports work with a dynamic code, and the QR code tracking guide shows how scans reach GA4.

What My Test Does Not Prove

I want to be clear about the edges of this data.

  • One code. I tested a single Version 3 code at error correction M. A Version 7 code or a code with a logo has less margin.
  • Simulated captures. The camera is a model: random scale, rotation, blur and noise. It is a fair proxy for comparing exports, not a phone benchmark.
  • Two open-source decoders. Phones use Apple Vision or Google ML Kit. Treat my numbers as a floor to design above, then test on real phones.
  • Digital print only. I did not test ink spread, paper texture or glare.
  • Only the files I exported. I could not download linkutm’s browser-side export for this test, so I used the specs on its tool page and my own segno exports.

The scripts and raw results are saved in my research folder, so anyone can rerun them. I would rather show the limits than hand you a clean rule that breaks on your printer.

Frequently Asked Questions

What size should a QR code PNG be?

At least 4 pixels per module, which is about 150 pixels wide for a Version 3 code. For print, export at least 8 pixels per module, or use SVG. In my test, 4 pixels per module was the first size where both decoders read every simulated scan.

Is PNG good for printing QR codes?

PNG works for print if you export it at the printed size and 300 DPI. SVG is the safer choice because it has no pixel grid to run out of. A print shop that resamples a PNG can soften the edges, so ask for the vector.

What resolution should a QR code PNG be?

Resolution is the pixel width, not the DPI tag. For a printed code, multiply the width in inches by 300 and check that you get at least 4 pixels per module. A 3 cm code needs about 354 pixels, which is 9.6 pixels per module for a Version 3 code.

Can a QR code PNG have a transparent background?

Yes, but the scan depends on the colour behind it. In my test, black modules read on white and mid-grey pages but failed completely on a near-black page. Flatten the code onto white before you share it.

Why does my QR code PNG look blurry?

Usually the file is too small and got enlarged, or smooth resampling turned the edges grey. Re-export at a larger size from the generator instead of enlarging. Setting a higher DPI tag does not add detail.

Is JPEG or PNG better for a QR code?

PNG is better. JPEG decoded fine in my black-and-white test, but the files were up to 59 times larger, and JPEG softens edges. Use PNG for screens and SVG for print.

To export a high-quality PNG QR code as PNG, SVG or PDF, try the free QR code generator. When you are ready to edit a printed code or see which placement drives scans, see the QR codes feature.

Bhargav Dhameliya

About Bhargav Dhameliya

Share this article

Ready to track your campaigns better?

Join thousands of marketers who use linkutm to build, track, and manage their marketing campaigns with ease.

Get Started for Free