How to Print a Barcode That Scans
To print a barcode that scans, print it within its allowed size range, keep the blank margins clear and use black bars on white. Then test the printed label with a phone before you print the full batch. For a retail EAN-13 or UPC-A code, GS1 Canada's symbol reference allows 80% to 200% of the nominal size, and the nominal-size code is 37.29 mm wide including its margins. On a label printer, also pick a size that gives every bar a whole number of printer dots.
Key takeaways
- Size: an EAN-13 or UPC-A barcode at nominal size is 37.29 mm wide with its quiet zones; GS1 allows 80% (29.83 mm) to 200% (74.58 mm).
- Margins: leave at least 11 module widths of blank space on the left of an EAN-13 and 7 on the right. In our test, a code with only 5 modules of margin beside a dark edge did not scan.
- Colour: black on white is the safest pair. Avoid red bars, because scanners read with red light.
- Label printers: at 203 dpi, 3 dots per bar module gives 113.7% size; 2 dots fall below the 80% minimum.
- Do not squash the height or stretch one direction only. Scale the whole code in proportion.
How big should a printed barcode be?
For the retail barcodes on products, EAN-13 and UPC-A, the reference is GS1, the body that issues product numbers. At nominal size the narrowest bar is 0.330 mm wide. GS1 Canada's symbol reference gives the allowed range as "80% - 200% (X-dimension 0.26mm - 0.66mm)" and recommends 150% to 200% for automated scanning, such as warehouses and distribution centres.
Both symbols are 95 modules of bars. Add the quiet zones (11 + 7 modules for EAN-13, 9 + 9 for UPC-A) and each is 113 modules wide. That gives these widths, which match the GS1 tables:
| Magnification | Narrowest bar (X) | Width incl. quiet zones | GS1 Sweden guidance |
|---|---|---|---|
| 80% (minimum) | 0.264 mm | 29.83 mm | Minimum for consumer items |
| Nominal | 0.330 mm | 37.29 mm | Recommended for consumer items |
| 150% | 0.495 mm | 55.94 mm | Minimum for outer packaging |
| 200% (maximum) | 0.660 mm | 74.58 mm | Recommended for outer packaging |
Two rules come with the size. First, keep the code in proportion: GS1 UK says "Re-sized barcodes must always be kept in proportion." Second, do not cut the bar height to make the code fit. GS1 UK's guidance is that the height "should not be reduced (truncated) unless absolutely necessary". At nominal size the minimum bar height is about 22.9 mm.
Barcodes for your own use, such as a Code 128 shelf label, have no GS1 size table, but the same logic applies. In GS1 Australia's words, "Generally, bigger barcodes scan more reliably."
Leave the quiet zones blank
The quiet zone is the empty strip either side of the bars. GS1 Sweden's size guide sets an EAN-13 at "At least 11 times X-dimension" on the left and "At least 7 times X-dimension" on the right, and says the UPC-A quiet zones "should be at least 9 times X-dimension" on both sides. For Code 128 and Code 39, label-printer and barcode-software documentation gives 10 times the narrow bar width.
We tested what happens when that margin shrinks. We drew one EAN-13 code, put a dark frame around it like a box edge or printed border, trimmed the margin step by step, and tried to read each version with the open-source zxing-cpp decoder:
| Quiet zone left / right | Result |
|---|---|
| 11 / 7 modules (the GS1 minimum) | Read |
| 5 / 5 modules | No read |
| 2 / 2 modules | No read |
| 0 / 0 modules | No read |
This was our own test on a clean digital image, not a print trial, so treat it as a principle rather than a limit for every scanner. In print, text, a border, a fold or the edge of the pack inside the quiet zone can stop a code that is otherwise fine. GS1 UK lists "printing text in the quiet zones" and "placing the barcode too close to the edge of a product" among the causes of failure. GS1 Australia goes further and recommends leaving "slightly more than the minimum".
Colours and materials that scan
The safest choice is black bars on white. GS1 Canada's reference says: "All colors of the red spectrum should be avoided for the creation of the bars due to the light source used for reading is red." To a red light, red bars look almost as pale as the background, so the code effectively disappears.
Some practical rules follow from that:
- Dark bars on a light background, not light bars on dark.
- No red, orange or pink bars. If the design needs a colour, pick a very dark one and test a printed sample.
- Avoid shiny material. GS1 Australia advises: "Avoid high gloss (reflective) substrates". Glare from a laminate or foil can wash out bars.
- Printing on a coloured or clear surface? GS1 UK suggests printing "a white underlay under your barcode image".
Printing on a label printer: dots per bar
A thermal label printer builds each bar out of whole dots. It cannot print half a dot, so the width of every bar is rounded to the printer's grid. If you scale a barcode image to an arbitrary size, some bars get rounded up and others down, and bars meant to be equal come out unequal.
The fix is to choose a size where one module is an exact number of dots. Here is our calculation for 203, 300 and 600 dpi printers, using an EAN-13 (one dot = 25.4 mm ÷ dpi):
| Printer | Dots per module | Narrowest bar | Magnification | Width incl. quiet zones |
|---|---|---|---|---|
| 203 dpi | 2 | 0.250 mm | 75.8% (below the 80% minimum) | 28.28 mm |
| 203 dpi | 3 | 0.375 mm | 113.7% | 42.42 mm |
| 203 dpi | 4 | 0.500 mm | 151.7% | 56.56 mm |
| 300 dpi | 4 | 0.339 mm | 102.6% | 38.27 mm |
| 300 dpi | 6 | 0.508 mm | 153.9% | 57.40 mm |
| 600 dpi | 7 | 0.296 mm | 89.8% | 33.49 mm |
So on a 203 dpi printer, an exact nominal-size EAN-13 is not possible: 0.330 mm would need 2.64 dots per module. Use 3 dots (113.7%) for a retail code, or 4 dots (151.7%) if it will also be scanned in a warehouse. On a 300 dpi printer, 4 dots per module lands at 102.6%, close to nominal.
How much does uneven rounding matter? In our decoder test, a clean on-screen EAN-13 resized to 2.64 pixels per module still read. Our decoder was forgiving on a clean image. Paper adds its own error. GS1 UK notes there "may be growth in the bars" on printing plates and that ink spread "can best be determined by running tests". The rounding error and the spread add together, which is why a whole number of dots is the safe habit for small codes.
One more label-printer tip from GS1 UK: "Rotate the barcode image so the bars are parallel to the direction of the printing."
Code 128 or Code 39 for your own labels?
If the barcode is for your own stock, shelves or files rather than a product sold in shops, you choose the format. The width difference is large. We worked out both for the same 8-digit stock number:
| Format | Modules incl. quiet zones | Width at 203 dpi, 2 dots/module |
|---|---|---|
| Code 128 (numeric mode) | 99 | 24.8 mm |
| Code 39 | 179 | 44.8 mm |
We counted the modules from barcodes generated with an open-source barcode library. Code 128 is shorter because, for digits only, its Code Set C "provides twice the packing density" of its other modes, according to Barcodes Inc's Code 128 specification. For a small label, Code 128 lets you use bigger modules in the same space, and bigger modules scan more reliably.
How to make and print a barcode with your phone
- Open Create Barcode in ScanMint AI and choose the format. Use EAN-13 or UPC-A only with a number registered to you through GS1; for internal labels, Code 128 is the compact choice.
- Type the value. The code is generated on your phone, offline.
- Export the image. Sharing is free for everyone. On the free plan the image carries a small ScanMint AI watermark. Saving to your photo gallery is a Premium action; one short rewarded ad unlocks it for a session.
- Place it at the right size. In your label or document software, set the width from the tables above and lock the aspect ratio. Leave the margins blank.
- Print one test label before the batch.
- Check it with Scan Barcode. Point the camera at the printed label. If it reads instantly from a normal distance, print the rest. If it struggles, go one size up, widen the margins or switch to black on white.
Making a first code is covered in How to Create a Barcode on Your Phone, and reading it back in How to Scan a Barcode With Your Phone. If you are printing a QR code rather than a barcode, the size and logo rules are different; see How to Customize a QR Code Without Breaking It.
Troubleshooting a printed barcode that will not scan
| Symptom | Likely cause | Fix |
|---|---|---|
| Phone finds the code but never reads it | Bars too thin for the printer | Print one size up, with whole dots per module |
| Reads on screen, not on the label | Ink or heat spread | Lower print darkness or heat; print larger |
| Fails next to a border or pack edge | Quiet zone too narrow | Move text and edges away; keep 11/7 modules for EAN-13 |
| Fails under shop lighting | Gloss or laminate glare | Use matte labels; tilt the camera slightly |
| Coloured code never reads | Red or light bars | Black bars on white |
| Short, squat code | Height cut down | Restore the full height in proportion |
Frequently asked questions
What is the smallest size I can print a UPC or EAN barcode?
GS1 Canada's minimum is 80% of nominal: the narrowest bar is 0.264 mm and the width 29.83 mm including quiet zones. It allows 75% only for on-demand print processes such as direct thermal printing.
Can I print a barcode on a normal home printer?
Yes, for your own labels. Print at the printer's best quality setting, at actual size (turn off "fit to page"), and test the printout with a phone before you rely on it.
Can I make a barcode smaller by reducing its height?
Avoid it. GS1 New Zealand permits truncation of retail codes in some cases but says it "should be avoided unless absolutely necessary", because it reduces how reliably the code scans.
Does a printed barcode need numbers under it?
The scanner reads the bars, not the digits. For retail codes, keep the human-readable number: it is the same data as the bars, so it can be typed in when the bars are damaged.
Summary
Print retail codes between 80% and 200% (29.83 to 74.58 mm wide for EAN-13 and UPC-A). Keep the quiet zones clear, use black on white and keep the full height. On a label printer, choose a size with whole dots per module. Then test one label with a phone before printing the rest. You can generate the code with Create Barcode and check every print with Scan Barcode in ScanMint AI, free on iPhone and Android from the download page.
Sources
- GS1 UK, How big should a point-of-sale barcode be?
- GS1 Canada, EAN/UPC Symbol Reference (PDF)
- GS1 Sweden, Size guide
- GS1 New Zealand, EAN-13 Barcode Specifications
- GS1 Australia, Creating and printing barcodes
- GS1 UK, How to improve barcode image quality (PDF)
- Zebra, ZPL guide: basic format for bar codes
- Barcodes Inc, Code 128 specification
- TEC-IT, Barcode quiet zones (PDF)
Tables marked as our calculation or test are reproducible: dot widths are 25.4 mm divided by the printer's dpi, and the quiet-zone test used the zxing-cpp decoder on generated EAN-13 images.
Tools covered in this guide
Open any of these in ScanMint AI to follow along.
Related guides
- Mobile Barcodes: How to Make Them ScanWhy a barcode on your phone scans at one counter and not the next, and six fixes for brightness, size, margins, colours and glare, from our own decoder test.
- How to Decode a Barcode: Read the Bars by HandA barcode is 95 narrow units of bars and spaces. Here is how to turn them into 13 digits by hand, find the hidden first digit and check your answer.
- Why Won't My Barcode Scan? 9 Phone FixesA barcode that won't scan usually needs one clean, complete line across its bars. Nine phone fixes for glare, distance, curves and clutter, from our own decoding test, and what to do when nothing works.
Try ScanMint AI free
Turn your phone into a pocket scanner and PDF toolkit — 18 tools, privacy-first.
