PDF vs SVG for Barcodes: Which Format Should You Use for Printing?
Written by Tomasz Lichosik
Ready to generate barcodes?
Create high-quality labels in seconds.
Download a barcode and you are usually offered raster formats like PNG and vector formats like PDF and SVG. For anything you intend to scan, raster is almost always the wrong call. That leaves a more interesting question: between the two vector options, PDF or SVG?
The format you save and print in is, genuinely, one of the biggest factors in whether a label scans first time or gets rejected at the till. Plenty of people reach for PNG or JPEG because that is what they use for web images — and that habit is exactly what trips up their barcodes. Here is why vectors win, and when each one is the right tool.
Why pixels are the enemy
To see why SVG and PDF both beat raster, you have to look at what happens when you resize a pixel image.
Raster graphics are a grid of coloured pixels. Resize one and the software has to invent values to fill the gaps, and to keep it looking smooth it applies antialiasing — soft grey pixels along the edges of black lines. For a photo, lovely. For a barcode, a problem. A scanner judges a code by the sharp contrast between dark bars and light spaces; those grey edge pixels blur the boundary, the scanner misreads the bar widths, and the scan fails.
Vector formats store the graphic as geometry instead — "draw a rectangle at X=10, Y=20, width 2, height 80." Scale, zoom, or stretch it however you like and the edges stay mathematically sharp: no smoothing, no grey, full contrast.
SVG: web-first and lightweight
SVG is an open, XML-based vector format from the W3C — under the hood, an SVG barcode is really a small text file describing paths and shapes.
Where it shines:
- Tiny files. A typical SVG barcode is 1–5 KB, which matters when an app is generating thousands on the fly.
- Native to the web. Every modern browser renders SVG directly; you can embed it in HTML, size it with CSS, or tweak its colours and margins with JavaScript in real time.
- Designer-friendly. It imports cleanly into Illustrator, CorelDRAW, Figma, or Canva as fully editable vector objects, so a barcode drops straight into a packaging layout without losing quality.
Where it falls short:
- No multi-page. SVG is a single canvas; it is not built for multi-page documents or label grids (a 3×7 sticker sheet) without awkward extra code.
- Legacy gaps. Some older industrial print software cannot open SVG directly.
PDF: print-ready and predictable
PDF, from Adobe in 1993, exists to present a document identically regardless of software, hardware, or OS.
Where it shines:
- Layout lock. A PDF pins down dimensions, margins, and positions to a fraction of a millimetre, so what the print shop or home printer produces matches the design exactly.
- Multi-page and grids. It handles 500 different codes in one file with ease, and it is the natural choice for sheets of labels — say 21 stickers on an A4 page.
- Embedded fonts. The human-readable text under the bars renders correctly even on a machine that does not have the barcode font installed, because the font travels inside the file.
Where it falls short:
- Heavier files. Metadata, compression, and font data mean even a single-code PDF runs 20–100 KB, well above a raw SVG.
- Not web-native. You cannot drop a PDF into an HTML page as code; it needs a viewer, which can slow a web app down.
So which one?
Match the format to the job:
| Use case | Use | Why |
|---|---|---|
| Website / web app display | SVG | Renders natively, loads fast, resizes live |
| Packaging and graphic design | SVG | Imports as an editable vector into design tools |
| Single label on a thermal printer | Either (SVG preferred) | Both are sharp; SVG is lighter and prints easily from the browser |
| Bulk printing and label sheets | One file, hundreds of codes, exact grid alignment | |
| Sending to a print shop | Locks margins, scaling, and fonts against printer mismatch |
One setting that decides it all
Whichever you pick, set your printer to 100% (Actual Size). Many PDF viewers default to "Fit to Page" or "Shrink Oversized Pages," which scales the code down a touch, distorts the X-dimension, and trips industrial lasers. Get that right and the rest follows.
You can generate clean SVG files or print-ready PDF sheets — EAN, Code 128, QR, and more — on BarcodeReady.