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 make one that scans first time.

By Altto · Updated 25 Sept 2026 · 7 min read

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

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 39Upper-case letters, numbers and a few symbolsWidely supported by older and 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-1313 digits (the last is a check digit)Retail products in the UK, Europe and most of the world — needs a registered GS1 number
UPC-A12 digits (the last is a check digit)Retail products in the US and Canada — also needs a registered GS1 number
EAN-8 / UPC-E8 digits / a compressed 6–8 digit UPCSmall packaging where a full EAN-13 or UPC-A won’t physically fit
ITF-1414 digitsOuter shipping cartons — the case-level version of a product’s retail number
CodabarDigits, the symbols -$:/.+, and A–D as start/stop charactersStill found on library systems and blood-bank labels
PharmacodeA single number, 3–131070Pharmaceutical 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

  1. Open Altto’s Barcode Generator and type the text or number you want to encode.
  2. 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.
  3. 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 DISPLAYBARCODE field 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?
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 is 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 contact card) and can be scanned from any angle. For a product number or reference code, 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 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.
What is the difference between EAN-13 and UPC-A?
UPC-A is a 12-digit retail barcode used mainly in the US and Canada; EAN-13 is the 13-digit version used in the UK, Europe and most other countries. A UPC-A number is effectively an EAN-13 with a leading zero, and retail scanners around the world read both. Which one you use normally depends on where your GS1 number was issued.
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. The last digit is also a check digit, so a mistyped number can be rejected. 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 letters and numbers.
Is my barcode data uploaded anywhere?
No. Altto's Barcode Generator builds the barcode entirely inside your 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?

Type your text, pick a format and download a PNG — free, no sign-up, no watermark, and nothing you type ever leaves your device.

Open Barcode Generator

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)