Reference · ten formats

Barcode types explained

Ten formats, what each one actually carries, and the situation it was designed for. If you are choosing rather than troubleshooting, start here.

The short answer

Choosing in one paragraph

Selling through shops outside North America, use EAN-13; in North America, UPC-A. Books use ISBN, which is an EAN-13 with a 978 or 979 prefix. Anything internal — SKUs, bins, work orders, asset tags — use Code 128. Shipping cartons use ITF-14, and logistics labels carrying batch numbers and dates use GS1-128. Need a phone to scan it, use a QR code. Marking something tiny, like a circuit board or a surgical instrument, use Data Matrix. Code 39 and EAN-8 exist for specific legacy and small-package cases.

Retail family

EAN-13, EAN-8, UPC-A and ISBN

These four are the same machinery wearing different clothes. All carry digits only, all end in a mod-10 check digit, all use the same guard-bar structure, and all are read by the same till scanners.

EAN-13 holds thirteen digits and is the global retail default. UPC-A holds twelve and is the North American variant — encode it as an EAN-13 with a leading zero and you get identical bars, which is why one scanner handles both. EAN-8 holds eight and exists only for packages too small to carry a full symbol; the numbers are allocated one at a time rather than as a company prefix. ISBN is not a separate symbology at all: a book's ISBN-13 is an EAN-13 whose prefix, 978 or 979, is the notional country code for "Bookland". An older ISBN-10 converts by dropping its check character, prefixing 978 and recalculating.

The common thread is that the number must be licensed. The bars are free; the identity in the global registry is not.

General purpose

Code 128, GS1-128, Code 39 and ITF-14

Code 128 is the workhorse. It encodes any ASCII character, switches between three internal character sets to stay compact, and carries a mandatory checksum the scanner uses and discards. For anything you scan yourself, this is almost always the right choice.

GS1-128 is Code 128 with structure imposed on it. A special FNC1 character at the start tells the scanner that the data is a series of application identifiers: (01) for a GTIN, (10) for a batch, (17) for an expiry date, (00) for a pallet licence plate. Fixed-length identifiers run together; variable-length ones are terminated by a separator. This is what appears on pallet labels and pharmaceutical packaging, and it is the format to use when another company's system has to parse your data rather than just read it.

Code 39 is the elder. It encodes uppercase letters, digits and a few symbols, needs no checksum, and is bulky — roughly three times the width of Code 128 for the same content. Its virtue is universality: essentially every scanner ever built reads it, which keeps it alive in defence, automotive and older healthcare systems.

ITF-14 carries fourteen digits and nothing else. It is designed for printing directly onto corrugated cardboard, where ink spreads and edges blur, so it uses thick bars and a heavy bearer-bar frame that keeps the printing plate from distorting the symbol. It identifies a case or pallet quantity of a product, not the product itself.

Two-dimensional

QR codes and Data Matrix

Linear barcodes hold a line of data; 2D codes hold a grid, which is why they carry far more in far less space. Both formats here include Reed–Solomon error correction, so a damaged or partly covered symbol still decodes.

QR codes won the consumer market because phone cameras read them instantly from any angle and at some distance. Their three corner finder patterns make orientation trivial to work out. Use them for links, Wi-Fi credentials, contact details — anything a member of the public will scan.

Data Matrix is the industrial equivalent. Its finder is an L-shaped solid edge with a dashed opposite edge, and it stays readable at sizes where a QR code would fail — a few millimetres square, laser-etched onto a component or printed on a vial label. Where a QR code would need roughly 25 modules a side for a short serial number, a Data Matrix manages it in 12 to 16. It is standard in electronics, aerospace, medical devices and pharmaceutical serialisation, and rare on consumer packaging because most people do not know to scan it.

At a glance

Comparison table

Data type, capacity and typical use for each supported format
FormatDataCapacityCheckTypical use
EAN-13Digits13Mod 10Retail worldwide
EAN-8Digits8Mod 10Small packages
UPC-ADigits12Mod 10North American retail
ISBNDigits13Mod 10Books
Code 128ASCII~80 charsMod 103Internal, logistics
GS1-128AI elements~48 charsMod 103Pallet and batch labels
Code 39A–Z 0–9 symbols~43 charsOptionalLegacy equipment
ITF-14Digits14Mod 10Cartons and pallets
QR CodeAny text~850 charsReed–SolomonPhone scanning
Data MatrixAny text~170 charsReed–SolomonSmall parts marking

Questions

Frequently asked questions

Which barcode format should I use?

Retail outside North America, EAN-13. North American retail, UPC-A. Books, ISBN. Anything internal, Code 128. Phone scanning, QR. Tiny items, Data Matrix.

What is the difference between Code 128 and GS1-128?

GS1-128 is Code 128 with a leading FNC1 character and data structured as application identifiers, so another company’s system can parse the fields rather than just read a string.

Is ISBN a separate barcode format?

No. An ISBN-13 is an EAN-13 with the 978 or 979 prefix. The bars are ordinary EAN-13 bars.

QR code or Data Matrix?

QR for anything the public scans with a phone. Data Matrix when the symbol must be very small or is marked directly onto a part.

Do you support PDF417?

Not yet. PDF417 is used on driving licences and boarding passes, and it needs a large cluster codeword table that we would rather implement and verify properly than approximate.

Why is Code 39 still around?

Because every scanner reads it. It is wasteful of space and has no mandatory checksum, so use Code 128 unless old equipment forces your hand.