How To Generate The Right Barcode Format For Packaging And Inventory
4 min read

A barcode only works if the scanner that reads it understands the format. Get the format wrong and the label prints beautifully while the scanner at the register or in the warehouse reads nothing.
The format question comes first, and it's decided by where the barcode will be scanned, not by which one looks tidier on the label.
Match The Format To The Scanner
Three common formats are CODE128, EAN-13 and UPC-A, and they aren't interchangeable.
CODE128 encodes letters, numbers and many symbols, though not every character, so check your value against the format's supported set. It's a common choice for internal use: shelf labels, asset tags, internal IDs and inventory bins, where your own scanners and your own software are the only readers. If the barcode never leaves your building, CODE128 is usually the answer.
EAN-13 is the retail format used in most markets outside North America: 13 digits, printed on product packaging and read at checkout. UPC-A is the older 12-digit equivalent, common in US retail. These geographic patterns are common, not universal, so the deciding source is whoever will scan the code. If a retailer or marketplace has given you packaging requirements, those requirements win over any general advice, including this paragraph.
The Number Is Not The Bars
For retail barcodes, you don't invent the digits. EAN-13 and UPC-A encode a GTIN, a globally registered product number you license through GS1 (gs1.org/standards/get-barcodes explains the process). The barcode image is just the machine-readable drawing of that number.
So the job splits in two. Getting the number is a registration task with GS1. Drawing the bars is a generation task you can do in a browser. A generator draws whatever you type; it cannot make an unregistered number valid at a checkout, and a scanner reading your barcode cleanly doesn't mean the number behind it is registered.
For internal CODE128 labels, you control the value entirely, which is exactly why it's the right tool for inventory: BIN-A4-SHELF-2 means something to your system and needs no one's permission.
Generate, Then Test Like A Skeptic
Once you know the format, check the data rules before generating. In this generator, EAN-13 takes 12 or 13 digits and UPC-A takes 11 or 12; the check digit is computed or validated for you. Type the digits, not spaces or dashes, and make sure the value you encode is the one your inventory or retail system expects.
Then test the physical thing, not the screen preview. A high-resolution PNG export is not a scan guarantee: print a test sheet at the actual label size and scan it with a real reader. Barcodes that scan perfectly on a monitor fail in print when the bars end up too small, the quiet zone (the blank margin around the bars) gets trimmed, or the label stock reflects light. The same goes for SVG: the file stays sharp, but final size and quiet zone still decide whether it scans.
Check the whole workflow while you're at it: scan the printed label, confirm your inventory system records the right item, and print one full sheet before committing to a label run of hundreds.
Generate One Now
The Barcode Generator on DigitalDecided covers the three formats above. Choose the format the retailer or scanner that will read your code requires, type the value, and download the result as a PNG at 3x or as an SVG. Whichever you pick, test the printed label at its final size with a real reader, and keep the quiet zone around the bars intact.
The tool's own reminder is worth repeating: for retail products you need your own registered GTIN. It draws the bars, not the number. Print a test sheet, scan it with a real reader, and only then run the full label batch.
