Printing and sizes
Barcode dimensions for print — how not to break a code in a graphics program
Module width, magnification, quiet zone and bar height. What you may change, what you may not, and why scaling by eye can be expensive.
6 min read
The most common way to break a barcode has nothing to do with a wrong number. It is dragging a corner in a graphics program so that the code "fits nicely" into the packaging artwork.
A barcode is a technical drawing. Its dimensions mean something, and there is a range within which you may change them.
Module width, or X
The narrowest bar in a code is called the module and is marked with the letter X. Every other element is a multiple of it: a double-width bar is 2X, a quadruple one is 4X. Changing X changes the whole code in proportion.
For an EAN-13 code the nominal size, known as 100 per cent, is X = 0.330 mm. The whole symbol is then about 37.29 mm wide, including the quiet zones. The standard allows magnification from 80 to 200 per cent of nominal, which means X from 0.264 to 0.660 mm.
That is the range you should not step outside. Our EAN-13 generator warns you when the value you enter falls outside it, and shows the dimensions of the finished code in millimetres before you download anything.
Why scaling by eye breaks the code
When you take a PNG file of a code and stretch it in a layout program, one of two things happens:
If you shrink it — X drops below the lower limit. The bars become narrower than the printer can reproduce, the ink spreads and neighbouring bars merge into one. The scanner either will not read the code or will read it only occasionally, which in practice is worse: the problem only shows up at the checkout.
If you enlarge it — X rises above the upper limit, and with a raster file the edges blur as well. The code takes up space and can still be unreadable.
That is why you download a code at its final size and place it without scaling. In Qreska you give the module width in millimetres and get a file with the right physical dimensions. SVG and PDF carry those dimensions within them; PNG stores them in its metadata as DPI.
The quiet zone
The clear space at the sides of a code is not an aesthetic margin. It is the quiet zone the standard requires, and without it a scanner cannot tell where the code begins and ends.
For EAN-13 it is 11 modules on the left and 7 on the right. At X = 0.330 mm that gives 3.63 mm and 2.31 mm of clear space respectively. Nothing may go there: no frame, no text, no label edge, no print in another colour.
This is the most common reason for codes that "worked on the sample but do not work in production". On the sample, the code sat alone on a white sheet. On the packaging, someone moved a line of text up against it.
Bar height
Height carries no information — a scanner reads the code along any horizontal line. But the taller the bars, the easier the code is to hit with a scanner and the better the chance of reading it at an angle.
For EAN-13 the nominal height is about 22.85 mm. You can shorten it if the packaging allows no more, but every reduction lowers the chance of a quick read. At a checkout, where every second counts, that is a real difference.
Colours
A scanner does not see colours, only contrast. The rule is simple: dark bars on a light background.
Black on white is the safest. Dark navy or dark green on a white background will work too. What to avoid:
- Red and orange bars. Older laser scanners shine red light, and to them a red bar is invisible — it merges with the white background.
- Inversions, meaning light bars on a dark background. Some scanners cope with them, some do not.
- Low contrast, for example grey on grey.
- A transparent background. A code on film with dark contents showing through no longer has a light background.
In the generator, red is blocked for one-dimensional codes, and a warning appears when the contrast is too low.
File format
- SVG — for layout and for offset printing. Vector graphics scale without loss of quality, and the physical dimensions are in the file.
- PDF — when the printer asks for a finished page at size. The code inside is a vector path, not an image.
- PNG — for the web, for previews and for label printers that only accept raster images. In that case, set the DPI so that the module comes out as a whole number of pixels — otherwise some bars will be wider and some narrower.
Before you send it to print
- Check the size: the module width within range, and the width of the whole symbol known.
- Check the quiet zone on the finished artwork, not on the code alone.
- Check the contrast under the light in which the code will be scanned.
- Print a sample on the actual material and scan it. Not on a different printer, not on different paper.
Step four is the most important and the most often skipped. Matt paper, gloss film and corrugated board behave entirely differently. The code reader lets you check a photo of the print without hunting for a scanner — if a phone reads the code from the photo, that is a good sign, though it does not replace a test with a real checkout scanner.
Verifying code quality
There is a difference between "the code scanned" and "the code meets the standard".
An ordinary scanner answers the first question, and it is lenient about it: it can read a code that is clearly worse than the standard allows, especially up close and in good light. The problem shows up later, at the checkout, at a different angle, on damaged packaging.
The second question is answered by a verifier — a device that measures the code against the standard and gives it a grade. It checks contrast, element widths, deviations and the quiet zone, and reports the result on a letter scale. GS1 Polska, the Polish GS1 organisation, is among those that offer a verification service.
Verification makes sense when you are supplying a retail chain that requires it, or when codes start causing trouble and you need to establish whether the print or the scanner is to blame. For a first run of labels for your own use, a sample and common sense are enough.
Printed on the packaging or a sticker
A code printed directly on the packaging is cheaper for large runs and does not peel off. On the other hand, any correction needs a new print run.
A sticker lets you fix a mistake and mark goods that arrived without a code. It costs more per piece, and you have to watch two things: that it does not cover information the packaging is required to show, and that it is not stuck over another barcode. Two codes side by side are a sure source of mistakes at the checkout.
Sources
Where we state a price, a date or a standard, we say where it came from and when we checked it. Sources change without our involvement.