Every barcode looks like the same pattern of black and white lines, but the format underneath it isn't interchangeable. Pick the wrong one for the job — say, a retail format for an internal stock label, or a text-friendly format for a product that needs a strict retail number — and it either won't scan at all, or it'll scan into the wrong system entirely. Here's what each format is actually for.
1D barcode vs QR code: the basic split
The barcodes covered in this guide are all 1D (linear) barcodes — a series of parallel lines of varying width, read in a single direction. They're compact and near-universal for scanning hardware, but they can only hold a small amount of data, usually a number. A QR code is a different, 2D format — a square grid that can hold far more (a full URL, Wi-Fi credentials, contact details) and scans from any angle with a phone camera. If you're encoding a product number, asset tag or reference code, you want a 1D barcode. If you're encoding a link or anything more than a short string, use a QR code instead.
The barcode formats, and what each one is for
| Format | Encodes | Typical use |
|---|---|---|
| Code 128 | Any letters, numbers or symbols | The safest general-purpose default — shipping labels, internal tracking, anything that isn't a registered retail product |
| Code 39 | Letters and numbers | Widely supported by older/industrial scanners; common on asset tags and ID badges |
| Code 93 | Letters and numbers, more compact than Code 39 | Logistics and inventory labelling where label space is tight |
| EAN-13 | Exactly 12–13 digits | Retail products sold in the UK and across Europe — needs a real, registered GS1 number |
| UPC-A | Exactly 11–12 digits | Retail products sold in the US and Canada — also needs a registered GS1 number |
| EAN-8 / UPC-E | 7–8 / 6–8 digits (compressed) | Small packaging where a full EAN-13/UPC-A won't physically fit |
| ITF-14 | 13–14 digits, even count | Shipping cartons and pallets — the outer-case equivalent of EAN-13/UPC-A |
| Codabar | Digits plus the symbols -$:/.+ | Still common on library systems and blood-bank specimen labels specifically |
| Pharmacode | A single number, 3–131070 | Pharmaceutical packaging, used purely as a production/print-quality check — not a product identifier |
Which one should you actually use?
- Selling a physical product through a shop or online marketplace that checks barcodes? You need EAN-13 (UK/Europe) or UPC-A (US/Canada), and it has to be a real number registered through your national GS1 organisation — a barcode you generate yourself with a made-up number will display and scan fine, but it won't match anything in a retailer's product database.
- Labelling a shipping carton or pallet of that same product? ITF-14 is the standard case-level format built on top of the same registered number.
- Tracking internal stock, assets, tickets or work-in-progress? Skip GS1 entirely — Code 128 or Code 39 will encode whatever reference text or number you choose, with no registration needed.
- Working with a library, or blood-bank specimen system? Codabar is the long-standing standard those specific systems were built around.
How to generate a barcode
- Open Altto's Barcode Generator and type the text or number you want to encode.
- Pick the format from the table above — the barcode updates live as you type or switch formats, and the tool tells you straight away if your text doesn't fit the format's rules (for example, too many or too few digits).
- Download it as a PNG, ready to print or drop into a label template.
Because it runs entirely in this browser tab, nothing you type is ever uploaded to a server — useful if what you're encoding is an internal reference number you'd rather not send anywhere.
Common questions
What's the difference between a barcode and a QR code?
Which barcode format should I use for a retail product?
Can I make a barcode without buying a GS1 number?
Why won't my text fit into EAN-13 or UPC-A?
Is my barcode data uploaded anywhere?
Ready to make one?
Altto's Barcode Generator runs entirely in your browser — free, no sign-up, no watermark, and nothing you type ever leaves your device.