The Right Way to Print a UPC or EAN Barcode

A barcode only works if a scanner can read it, and a scanner only reads it reliably if it’s printed correctly. Every year, products get rejected by retailers or returned by manufacturers because the barcode on the package looks fine to the eye but fails at the register. Understanding how these codes actually work makes it obvious why print quality matters as much as the numbers underneath it.

How a UPC or EAN barcode actually works

A UPC-A or EAN-13 barcode is a series of black bars and white spaces of varying widths, arranged to represent a string of digits. A laser or camera scanner reads the code by measuring the width of each bar and space as it passes over them. Those widths translate directly into the digits printed below the bars, which is why the human-readable numbers and the bars themselves always need to match exactly.

The scanner isn’t reading the numbers; it’s reading contrast. It needs a clean, sharp transition between dark and light every time a bar starts or ends. Anything that blurs that transition, whether it’s low print resolution, poor contrast, or a background pattern behind the code, makes the scan fail or forces a cashier to key the numbers in by hand, which defeats the purpose of having a barcode at all.

Color: stick to black bars on a white background

This is the one area where there’s no real room for creative choice. A UPC or EAN barcode should be printed in solid black bars on a plain white or very light background. Scanners read contrast, and black on white gives the highest possible contrast a print process can produce.

Warning: red bars will fail on most scanners

Many laser scanners, still widely used at grocery and big-box registers, read barcodes using a red laser light. A red laser cannot distinguish red ink from white background, because to that light source red and white reflect nearly the same way. A barcode printed with red, orange, or pink bars can look perfectly readable to a human eye and still be completely invisible to a huge share of scanners in active use. This is one of the most common and most avoidable reasons a barcode gets rejected, and it’s worth checking specifically if a designer or print vendor ever proposes a colored version of the code.

What’s actually safe for the bars

Solid black is the only color that should be used for the bars themselves. It’s the only color guaranteed to work across laser and camera-based scanners alike, and it’s what GS1 specifies as standard. Very dark colors like navy or dark brown are sometimes used in specific commercial print contexts, but they carry real risk, since even a slightly lighter shade than intended, a shift in ink batch, or a lower quality printer can drop the contrast below what a scanner needs. Unless you have a specific reason and are testing carefully, don’t use anything other than true black for the bars.

What’s actually safe for the background

The background should be white or a very light, uncolored tint, plain with no pattern, gradient, texture, or image behind the bars. Light pastel backgrounds can sometimes work if contrast is tested carefully, but white remains the safest and most universally reliable choice. Reversed color schemes, meaning light bars on a dark background, should never be used under any circumstances, since that inverts the contrast relationship scanners are built around and will fail consistently. Backgrounds with any pattern, texture, gradient, or image behind the bars are one of the most common reasons a barcode fails inspection, because the scanner can’t distinguish the actual bar edges from the noise behind them.

If brand consistency is important, keep the surrounding label colorful and keep the barcode itself, along with a clean margin around it, in strict black and white.

Scaling: don’t touch the proportions

Your EPS and JPG files are built at 1 inch by 1.5 inches, and that size isn’t arbitrary. It’s within the standard range GS1 recommends for retail scanning, giving the bars enough width to stay distinguishable at typical checkout scanning distances.

If you need to resize the barcode to fit your packaging, scale it proportionally, meaning both dimensions change by the same percentage. GS1 guidelines generally allow scaling down to around 80 percent and up to about 200 percent of nominal size before bars become too thin to scan reliably or so large they don’t fit standard scan windows. Never stretch a barcode wider without also making it taller, or vice versa. Stretching only one dimension distorts the relative bar widths the scanner depends on, which can make an otherwise perfect barcode unreadable even though it still looks correct to the eye.

The EPS file is a vector format, so it scales without any loss of quality and is the better choice any time the barcode needs to be resized. The JPG is a fixed-resolution raster image, and enlarging it past its native size will introduce blur at the bar edges, which is exactly the kind of soft transition that causes scan failures. If you need a larger barcode, scale the EPS rather than stretching the JPG.

Cropping: leave the quiet zone alone

The blank white space on either side of the bars is called the quiet zone, and it isn’t an empty margin you can trim away. Scanners use that blank space to recognize where the barcode starts and ends. Crop into it, place text or graphics inside it, or push another design element up against the bars, and you risk the same read failures caused by bad contrast, even though the bars themselves are printed perfectly.

When placing the barcode file in your packaging design, treat the entire file, including the quiet zone, as a single locked unit. Don’t crop the image tighter to save space, and don’t rotate or skew it. If you need more white space around the barcode for layout reasons, that’s fine and often helps, but never reduce it beyond what’s provided in the original file.

Resolution and print material matter too

For printed packaging, aim for a minimum of 300 dpi at the barcode’s final printed size, higher if your printer or packaging material tends to spread or bleed ink, like uncoated cardboard or certain flexible films. Glossy or coated stock generally holds sharp bar edges better than matte or textured paper.

Thermal printers, common for shipping labels, have their own considerations. Direct thermal printers can degrade over time with heat or friction exposure, so if the barcode needs to stay scannable for weeks after printing, thermal transfer with a resin ribbon holds up better than direct thermal alone.

Test before you print at scale

Before committing to a full print run, print a single test copy at final size on your actual packaging material and scan it with a standard retail scanner or a barcode scanning app. This catches problems that are hard to spot by eye, like a laser printer’s toner not laying down solid enough black, or a background color that reads as too close to the bars in low light. It’s a five-minute check that avoids a warehouse of packaging getting rejected at a distribution center.

Printing barcodes yourself with a label printer

Plenty of small businesses skip commercial printing entirely and print barcode labels in-house, and that’s a completely viable approach as long as the equipment and materials are matched to the job.

Desktop thermal label printers, such as the common Zebra or Rollo-style printers, are usually the best option for DIY barcode printing. They’re built specifically for label stock, produce sharp, consistent bar edges at typical retail barcode sizes, and don’t have the ink-bleed issues that can show up with inkjet printers. Direct thermal printers work fine for labels that will be scanned within a few weeks, since the print can fade or darken with heat and light exposure over time. If labels need to stay scannable for months, such as on inventory that sits in a warehouse before shipping, a thermal transfer printer using a resin ribbon holds up considerably longer.

A standard laser printer is the next best option, especially for lower-volume runs. Laser toner produces genuinely solid black, which is exactly what a scanner needs, and laser output doesn’t smear the way inkjet can on coated label stock. Print at the highest quality setting available, not the default draft or economy mode, since some printers reduce resolution automatically to save toner.

Inkjet printers are the weakest choice for barcode labels and should be avoided if another option is available. Ink can feather slightly into the paper fibers, especially on uncoated label stock, softening the sharp edges a scanner depends on. If inkjet is the only option on hand, use labels specifically rated for inkjet printing rather than general-purpose label paper, and check a test print closely for any blurring at the bar edges before printing a full batch.

Whatever printer you use, print on white, matte label stock rather than glossy when possible. Glossy stock can create glare at certain scanner angles and lighting conditions, particularly with handheld laser scanners, whereas matte stock generally provides more even, predictable contrast. Avoid printing directly onto colored or textured packaging as a substitute for a label. Even if the barcode file itself is correctly black and white, printing it onto anything other than a flat white surface reintroduces the same contrast problems described above.

Finally, when creating labels yourself, place the barcode file into your label design software at its original size or a proportionally scaled version, never resized by dragging one corner or one edge independently. Most label design programs have a lock aspect ratio option, and it should stay on for the barcode element specifically, even if other parts of the label are adjusted freely.

The short version

Keep the bars black and the background white, don’t scale the two dimensions differently, don’t crop into the quiet zone, use the EPS file whenever resizing is involved, and print a test copy before running the full batch. Barcodes are simple by design, and that simplicity is exactly why they’re unforgiving when the basics aren’t followed.