# Vector vs raster QR codes

> A vector QR code (SVG or PDF) scales to any size with perfectly sharp edges; a raster (PNG) must be generated at 300 DPI or more at the final printed size — a 3 cm code needs at least 354 pixels across. When in doubt, hand the print shop the SVG.

Source: https://useqr.app/docs/spec/vector-vs-raster-qr-codes · Last reviewed 2026-08-21 · UseQR is free forever, MIT licensed, no signup.

---

## The difference in one sentence

A raster file stores **pixels** — a fixed grid of colour samples that can only be
stretched; a vector file stores **geometry** — "a filled square from here to here" — that
is redrawn from scratch at whatever resolution the output device offers. A QR code is
pure geometry (a matrix of squares), which makes it the ideal vector subject: the
[SVG representation](/docs/spec/qr-code-svg-path-structure) is small, exact and
resolution-independent.

The practical asymmetry: a vector QR code is *always* sharp, at business-card size and on
a building wrap, from the same file. A raster QR code is sharp at exactly one size and
degrades above it.

## The raster arithmetic

Print quality convention: **300 DPI minimum** at the final physical size (600 for fine
work — the trade-offs are on [QR code DPI for printing](/docs/print/qr-code-dpi-for-printing)).
The conversion:

```
pixels needed = size in cm ÷ 2.54 × DPI
```

Worked example — a 3 cm code on a flyer:

```
3 ÷ 2.54 × 300 ≈ 354 px minimum
```

More reference points at 300 DPI:

| Printed size | Minimum pixels |
|---|---|
| 2 cm | 236 px |
| 3 cm | **354 px** |
| 5 cm | 591 px |
| 10 cm | 1,181 px |
| 20 cm (poster) | 2,362 px |

Two habits follow. First, generate raster **for the destination**, not from whatever file
is lying around — a 512 px PNG is generous for a 3 cm flyer code and hopeless for a 20 cm
poster. Second, never *upscale*: enlarging a small PNG interpolates new grey pixels along
module edges, which is why enlarged codes look
[pixelated or soft](/docs/troubleshooting/qr-code-pixelated-when-enlarged) and scan
worse than their size suggests. Downscaling is comparatively harmless as long as
[modules keep enough pixels](/docs/spec/module-size-vs-camera-resolution).

## When each wins

**Vector (SVG, vector PDF):**

- anything a print shop touches — see
  [why you should print QR codes from SVG](/docs/print/why-you-should-print-qr-codes-from-svg);
- artwork that will be reused at multiple sizes;
- cutters, engravers and plotters, which consume paths, not pixels;
- design hand-off, where someone else chooses the final size after you.

**Raster (PNG):**

- fixed-size screen use: web pages, email signatures, slides, chat;
- systems that cannot place SVG (some office tools, some label printers);
- final-step exports where you control the size and the DPI.

The honest caveat in the vector column: a vector file is only as good as the pipeline
that rasterises it. Print RIPs and cutting software occasionally mangle advanced SVG
features — which is why UseQR offers a stripped SVG Tiny profile for print hand-off — and
a vector code with too-small modules still fails
[for the camera](/docs/spec/qr-code-density-and-scan-distance) no matter how sharp the
ink. Vector solves resolution; it does not solve size, contrast or the
[quiet zone](/glossary/quiet-zone).

Size the physical code with the [size calculator](/size-calculator), and prove the final
artwork with [/validate](/validate) before committing to a run.

## FAQ

### Is SVG or PNG better for a QR code?
SVG whenever the code might be resized or printed — it stays perfectly sharp at any size. PNG is fine for fixed-size screen use, generated at or above the display size. JPEG is wrong in all cases.

### How many pixels does a printed QR code need?
Final size in centimetres, divided by 2.54, times 300. A 3 cm code needs at least 354 pixels across; a 10 cm code needs about 1,181. Doubling to 600 DPI is worthwhile for small codes on quality stock.

### Can I enlarge a QR code PNG for a poster?
Not meaningfully. Upscaling invents blurred pixels along module edges rather than adding detail, and large prints magnify the damage. Regenerate the code as SVG, or as a fresh PNG at the poster's full size and 300 DPI.

### Do print shops accept SVG files?
Usually, though many prefer PDF. Exporting the SVG to PDF preserves the vector geometry, so either hand-off is equivalent. Confirm the code was not rasterised along the way by zooming into the proof — vector edges stay razor sharp at any zoom.

## Try it

- https://useqr.app/url
- https://useqr.app/size-calculator
- https://useqr.app/validate
