Guide

Barcode types explained: which one should you use?

Code 128, EAN-13, UPC-A, Code 39 — barcode formats look interchangeable until you pick the wrong one and it won't scan. Here's what each one actually encodes, when to use it, and how to generate one free in seconds.

Guide · 6 min read

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

Common 1D barcode formats
FormatEncodesTypical use
Code 128Any letters, numbers or symbolsThe safest general-purpose default — shipping labels, internal tracking, anything that isn't a registered retail product
Code 39Letters and numbersWidely supported by older/industrial scanners; common on asset tags and ID badges
Code 93Letters and numbers, more compact than Code 39Logistics and inventory labelling where label space is tight
EAN-13Exactly 12–13 digitsRetail products sold in the UK and across Europe — needs a real, registered GS1 number
UPC-AExactly 11–12 digitsRetail products sold in the US and Canada — also needs a registered GS1 number
EAN-8 / UPC-E7–8 / 6–8 digits (compressed)Small packaging where a full EAN-13/UPC-A won't physically fit
ITF-1413–14 digits, even countShipping cartons and pallets — the outer-case equivalent of EAN-13/UPC-A
CodabarDigits plus the symbols -$:/.+Still common on library systems and blood-bank specimen labels specifically
PharmacodeA single number, 3–131070Pharmaceutical 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

  1. Open Altto's Barcode Generator and type the text or number you want to encode.
  2. 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).
  3. 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?
A barcode (also called a 1D or linear barcode) is a series of parallel lines that stores a small amount of data — usually a number, sometimes short text — and needs to be scanned along one direction. A QR code is a 2D barcode: a square grid that can hold far more data (a URL, Wi-Fi details, a whole vCard) and can be scanned from any angle. If you need to encode a product number, use a 1D barcode; for a link or larger payload, use a QR code.
Which barcode format should I use for a retail product?
EAN-13 (used across the UK and Europe) or UPC-A (used in the US and Canada) — but only with a real barcode number issued by GS1 through your country's national GS1 organisation. A barcode you generate yourself with a made-up number will scan and display that number, but it won't be recognised by any retailer's product database, because it was never registered.
Can I make a barcode without buying a GS1 number?
Yes, for anything that isn't a retail product sold through a shop or marketplace that checks GS1 registration. Code 128 or Code 39 are the natural choice for internal use — asset tags, stock-room labels, event tickets, library items, work-in-progress tracking — since they'll encode any text or number you choose with no registration needed.
Why won't my text fit into EAN-13 or UPC-A?
EAN-13, EAN-8, UPC-A, UPC-E and ITF-14 are all fixed-length, digits-only formats — no letters, and a specific digit count each. If your text has letters in it, or doesn't match that digit count, switch to Code 128 or Code 39, both of which accept any combination of letters and numbers.
Is my barcode data uploaded anywhere?
No. Altto's Barcode Generator builds the barcode entirely inside this browser tab, on your own device — there's no server involved, so nothing you type is ever sent, seen or stored 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.

Open Barcode Generator