How to Generate Barcodes That Actually Scan
A barcode is not a picture of a number — it is the number itself, drawn as bars a scanner can read back. This guide covers symbology, check digits, quiet zones, print quality, and testing before you print in bulk.
What a barcode actually is
A barcode is not a picture of a number. It is the number itself, drawn as bars and spaces that a scanner can read back. If the bars do not match the number exactly, the scanner reads a different number — or nothing at all. That is why a barcode that "looks fine" can still fail at a checkout: the drawing, not the design, is what matters.
Every barcode has three parts: the data (the digits or characters you encode), a check digit in most symbologies (an extra digit calculated from the rest, so a misread is caught), and a quiet zone — blank space on both sides that tells the scanner where the code starts and ends. Remove the quiet zone and even a perfect code becomes unreadable.
Choosing the right symbology
Use Code 128 for general use: warehouse labels, asset tags, tickets, internal tracking. It encodes letters and digits, it is compact, and almost every scanner reads it.
Use EAN-13 only for retail products sold in stores. It is always exactly 13 digits, and the first digits identify the country or numbering authority. A made-up 13-digit number is not a valid retail barcode: real retail codes are issued through GS1, the organisation that manages product numbers worldwide. If you are selling in shops, get your numbers from GS1 rather than inventing them — a self-made EAN can collide with another company's product.
Use UPC-A for retail in North America. It is 12 digits and works the same way as EAN-13, through GS1.
Use Code 39 only when an old system demands it. It encodes fewer characters and takes more space than Code 128 for the same data.
Check digits: let the tool calculate them
For EAN-13 and UPC-A, the final digit is a check digit, calculated from the other digits (the GS1 Mod-10 method). Never guess it and never copy a check digit from a different number. Type the digits you have and let the generator complete or verify the check digit for you. If the tool tells you a number is invalid, the number is wrong — do not force it through by changing a digit at random.
Quiet zones and print quality
Leave blank space at least as wide as ten narrow bars on each side of the code. Do not crop it, do not put text or a logo inside it, and do not let a label border touch the bars. Print in black on white whenever you can: scanners read contrast, and light bars on a dark background, glossy reflections, and low printer resolution are the most common reasons a printed code fails. A code printed smaller than about 30 mm wide is hard for handheld scanners to read reliably; if the label is small, test it before printing a thousand copies.
Test before you print in bulk
Print one copy, scan it with a phone and with the actual scanner that will be used, and check that the number read back matches the number you encoded. Test at the distance the scanner will really be used at, under the real lighting. If it fails, the usual culprits in order are: missing quiet zone, too small, poor contrast, and a wrong check digit.
What this tool does and does not do
The free Barcode Generator on this site draws Code 128, Code 39, EAN-13 and UPC-A barcodes in your browser, validates your number, completes check digits where the symbology defines them, and exports PNG or SVG. It does not issue GS1 numbers and it does not register your product anywhere: for retail sale, your numbers must come from GS1. Everything runs on your device, so the numbers you encode are never sent to a server.
If you need a code that links to a web address instead of encoding a product number, the QR Code Generator makes QR codes, and our QR generator guide explains when a QR code beats a barcode.