Barcode Generator — Code 128, EAN-13, UPC-A, Code 39 & ITF
Generate scannable retail and logistics barcodes, with the check digit and print size checked as you type.
A barcode generator turns a number or short string into the bar and space pattern a scanner reads. Retail codes — EAN-13, EAN-8, UPC-A — end in a check digit computed from the others, and this calculates it for you, or refuses the input if you supplied one that does not match. The output is SVG, so it stays sharp at any print size.
Runs in your browser- Output
- SVG — sharp at any size, unlike a fixed-resolution PNG
- Check digits
- Calculated automatically, and verified if you supply one
- Print check
- Bar width in real millimetres, quiet zone and contrast
- Symbologies
- Code 128, EAN-13, EAN-8, UPC-A, Code 39 and ITF-14
- Privacy
- Runs entirely in your browser — nothing is uploaded
- Cost
- Free, unlimited, no sign-up
Which symbology to use
A barcode symbology is a grammar, not a format. Each one accepts a different character set, a different length, and is read by a different set of hardware, so the choice is usually made for you by whatever system has to scan the label.
| Symbology | Encodes | Used for |
|---|---|---|
| EAN-13 | 13 digits, the last a check digit | Consumer products sold at retail worldwide. The number is allocated by GS1 to a registered company, not invented. |
| EAN-8 | 8 digits | Small retail packaging with no room for a full EAN-13. |
| UPC-A | 12 digits | Retail in the United States and Canada. A scanner reads it as an EAN-13 with a leading zero. |
| Code 128 | The full ASCII set, variable length | General-purpose logistics and internal labelling. Its numeric code set packs two digits into one symbol character, so digit strings stay compact. |
| Code 39 | Digits, A to Z uppercase, space and - . $ / + % | Older industrial, defence and identity-card systems. Self-checking, but noticeably wider than Code 128 for the same data. |
| ITF-14 | 14 digits | Shipping cartons carrying a GTIN-14. Tolerant enough to be printed directly on corrugated board. |
The check digit
EAN-13, EAN-8, UPC-A and ITF-14 all end in a check digit derived from the digits before it. Positions are weighted alternately by one and three, the weighted values are summed, and the check digit is whatever brings that total up to the next multiple of ten. A scanner recomputes it on every read and discards the scan when it disagrees.
That is the only error detection a linear barcode has, which is why a wrong check digit produces no scan at all rather than a wrong one. The generator computes it for you, and if you supply the full number it verifies the digit you gave rather than quietly replacing it.
Printing one that scans
- Keep the quiet zone. Every symbology needs a blank margin either side, specified in modules rather than millimetres, and it is not symmetric for EAN and UPC. Cropping it is the most common reason a printed code fails.
- Respect the module width. Below roughly a quarter of a millimetre per module, ink spread on thermal and flexographic printing starts merging adjacent bars. Check the printed width, not the on-screen one.
- Never scale non-uniformly. Stretching the symbol horizontally changes the ratio between wide and narrow elements, which is exactly what the decoder measures.
- Print dark bars on a light ground. Red and orange bars are invisible to a red-light laser scanner, and a glossy laminate adds glare that defeats imagers.
- Export vector. The output here is SVG so the bar edges stay on exact boundaries at any size, which a resampled PNG cannot guarantee.
To check a finished label, decode it back with the barcode reader and confirm the string matches what you typed. For anything that needs to carry more than a number, a QR code holds arbitrary text rather than a fixed-length key.
Frequently asked questions
Why will my barcode not scan?
Can I make up my own EAN-13 number?
Which barcode type should I use?
Why does the check digit matter so much?
How to use the barcode generator
- 1Choose the barcode type your system expects.
- 2Enter the number or text to encode.
- 3Set the bar width and height for your label size.
- 4Copy the SVG, or save it and place it in your artwork.
Sources & specifications
Embed this tool
Put the working barcode generator on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.
Share this tool
Related tools
Last updated
More qr & barcodes