Barcode symbologies: choosing between Code 128, QR and DataMatrix

Choosing between barcode symbologies is usually treated as a technical detail and settled by whatever the label software defaulted to. It is worth thirty minutes of thought, because the wrong choice shows up later as scan failures on a production line, and by then the labels are printed.

The linear ones

EAN-13 and UPC-A are the retail codes on consumer products. They encode a fixed-length number that identifies a product globally, and the number is issued rather than invented. If you are selling through retail, this is not a choice, it is a requirement.

Code 39 is old, tolerant and inefficient. It encodes uppercase letters and digits, produces a wide barcode for very little data, and needs no check digit. It survives in industrial and defence settings largely through inertia. There is rarely a good reason to choose it for something new.

Code 128 is the sensible default for internal linear use. It handles the full character set, is considerably denser than Code 39, and includes a check character. If you need a linear barcode for an internal reference, start here.

GS1-128 is Code 128 with structure: standardised prefixes that tell the reading system what each piece of data means, so one barcode can carry a batch number, an expiry date and a quantity in a way another organisation’s system can interpret. If your labels leave your building and enter someone else’s supply chain, this is what you want.

The two-dimensional ones

QR codes hold a lot in a small square, tolerate damage well, and are readable by any phone. That last point is the deciding factor most of the time. If a human needs to scan it with the device already in their pocket, use QR.

DataMatrix is denser than QR at small sizes and is the standard choice for marking small items directly: components, instruments, circuit boards. It reads reliably at a few millimetres square, where a QR code of equivalent capacity would be larger. Phones can read it, but less universally, so it suits fixed scanners and dedicated devices.

PDF417 is the stacked rectangular code on driving licences and boarding passes. It carries a lot of data in a shape that suits a strip rather than a square. Outside document applications it is rarely the right answer now.

The three questions that decide it

  1. How much data? Under about twenty characters, linear is fine and easier to scan at distance. More than that, go two-dimensional.
  2. How much space? Linear codes get wide fast. On a small item, 2D is often the only thing that fits legibly.
  3. What will happen to the label? This is the one people forget.

Damage tolerance is the underrated factor

Two-dimensional codes carry error correction, which means a portion of the code can be obscured, scratched or torn and it will still read. QR in particular has selectable levels of it: more correction means a denser code for the same data, but a much better chance of surviving a scuffed carton.

Linear barcodes have no such redundancy. A scratch through the bars is a failed scan.

If your labels live in a freezer, get handled with gloves, travel on a pallet, or sit on a machine that produces oil mist, choose 2D with high error correction and stop optimising for size.

Practical details that cause failures

  • Quiet zone. Barcodes need clear space around them. Crowding the design against the code is the most common cause of intermittent scan failure.
  • Contrast and material. Black on white reads best. Glossy laminate causes reflection under some scanners. Test on the actual material, not on office paper.
  • Print method. Thermal transfer survives abrasion and heat far better than direct thermal, which fades in sunlight and warmth. For anything that must remain readable for months, use transfer.
  • Verify, do not just look. A print quality verifier grades a barcode against a standard. A scanner that reads it once at close range on a good day tells you very little.

Choosing between barcode symbologies: a reasonable default

Internal tracking with modest data: Code 128. Anything entering an external supply chain: GS1-128 or GS1 DataMatrix. Small items or harsh environments: DataMatrix. Anything a member of the public or a colleague will scan with a phone: QR.

Getting this right at the design stage is far cheaper than reprinting. It is part of what our AIDC and mobility work covers, alongside the scanners and the systems the data lands in.

Related reading

Dealing with something like this?

We are happy to give an honest read on it before anyone writes a proposal. No obligation, and we will tell you if the answer is that you do not need us.

Start a project

Tell us about your project. We’ll get back within 24 hours with a clear assessment and timeline.

Get in touch

Quick question? Send us a message.