Quick answer: for most jobs, use Code 128. It encodes any letters, numbers or symbols, and almost every scanner reads it. Use EAN-13 (UK and Europe) or UPC-A (US and Canada) only for products sold in shops, and only with a number registered through GS1.
Encoding a web link or anything longer than a short code? Use a QR code instead. To make a 1D barcode now, Altto’s Barcode Generator builds one in your browser as you type.
What is the difference between a barcode and a QR code?
The barcodes covered in this guide are all 1D (linear) barcodes — a row of parallel bars of varying width, read in a single direction. A scanner measures the widths of the bars and the gaps between them, and each format has its own rulebook for turning those widths back into characters. They’re compact and near-universal, but hold only a short number or reference.
A QR code is a 2D format — a square grid that can hold far more (a full URL, Wi-Fi details, 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, see our guide to practical ways to use a QR code.
The main barcode types, 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 | Upper-case letters, numbers and a few symbols | Widely supported by older and 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 | 13 digits (the last is a check digit) | Retail products in the UK, Europe and most of the world — needs a registered GS1 number |
| UPC-A | 12 digits (the last is a check digit) | Retail products in the US and Canada — also needs a registered GS1 number |
| EAN-8 / UPC-E | 8 digits / a compressed 6–8 digit UPC | Small packaging where a full EAN-13 or UPC-A won’t physically fit |
| ITF-14 | 14 digits | Outer shipping cartons — the case-level version of a product’s retail number |
| Codabar | Digits, the symbols -$:/.+, and A–D as start/stop characters | Still found on library systems and blood-bank labels |
| Pharmacode | A single number, 3–131070 | Pharmaceutical packaging, used as a production and packing check — not a product identifier |
Which barcode type should you use?
- Selling a physical product through a shop or online marketplace? 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 with a made-up number will display and scan fine, but it won’t match anything in a retailer’s product database.
- Labelling a carton of that same product? ITF-14 is the standard case-level format, built on 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 you choose, with no registration needed.
- Replacing labels in an existing system? Match the format it already uses — a library built around Codabar will expect Codabar.
Do you need a GS1 barcode number?
Only for products sold at retail. GS1 is the not-for-profit body that issues the numbers behind EAN and UPC barcodes; in the UK that’s GS1 UK, which charges an annual membership fee based on the size of your business. Membership gives you a company prefix, and every product variant (each size, colour or flavour) gets its own number built from it.
Large marketplaces, Amazon included, check product barcodes against GS1’s records, so cheap numbers bought second-hand from resellers can be rejected, or turn out to be registered to another company. If you’re only labelling things for your own use, none of this applies: any number or text you choose is fine.
What the check digit does
The last digit of an EAN or UPC number isn’t part of the product number itself. It’s a check digit, calculated from the other digits, so a scanner can tell straight away if it has misread a bar. That’s why EAN-13 needs exactly 12 or 13 digits in Altto’s generator: give it 12 and the 13th is worked out for you; give it 13 with the wrong final digit and it’s flagged as not fitting the format.
How to make a barcode
- Open Altto’s Barcode Generator and type the text or number you want to encode.
- Pick the format from the list. The barcode updates live as you type or switch formats, and the tool tells you straight away if your text doesn’t fit that format’s rules — letters in a digits-only format, or the wrong number of digits.
- Click Download PNG. You get black bars on a white background with the encoded text printed underneath, ready to drop into a label template.
Because it runs entirely in your browser tab, nothing you type is ever uploaded to a server — useful if what you’re encoding is an internal reference or stock code you’d rather keep to yourself.
Other ways to make a barcode
- Microsoft Word: Word has a
DISPLAYBARCODEfield code that can draw several barcode types, including Code 128, Code 39, EAN-13 and UPC-A, inside a document. It’s handy for mail merges, but fiddly by hand. - Barcode fonts: free fonts can turn typed text into bars. Code 39 fonts are the easiest, since you just wrap the text in asterisks (
*ABC123*). Code 128 and EAN fonts need the text encoded with a checksum first, so typing plain numbers into them won’t give you a scannable code. - Label printer software: dedicated label printers usually come with software that has barcodes built in.
How to print a barcode that scans first time
- Don’t stretch or squash it. The information is in the relative widths of the bars, so resize it evenly (keep the aspect ratio locked) rather than dragging one side.
- Leave the white margin alone. Scanners need a clear “quiet zone” either side of the bars to find where the code starts and ends. Don’t crop it off or print text right up against it.
- Keep it dark on light. Black on white is safest. Avoid red bars: most laser scanners use red light, so red bars can look the same as the background.
- Don’t shrink it too far. Very thin bars blur on cheaper printers and labels.
- Test before you print a batch. Print one, scan it with the scanner you’ll actually use, and check the result matches what you typed.
The PNG is a lossless image, so it keeps its sharp edges — if you’re curious why that matters, see JPG vs PNG.
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?
What is the difference between EAN-13 and UPC-A?
Why won't my text fit into EAN-13 or UPC-A?
Is my barcode data uploaded anywhere?
Ready to make one?
Type your text, pick a format and download a PNG — free, no sign-up, no watermark, and nothing you type ever leaves your device.
Sources
Where the GS1 registration advice in this guide comes from:
- GS1 UK — Get a barcode (GS1 issues the numbers behind EAN and UPC barcodes; UK membership, and advice to get product numbers directly from GS1)