Barcode Scanners

Barcode Symbologies Explained: Code 128, GS1-128, Data Matrix and More

Sarah Jane Sep 08, 2026 5 min read

Barcode symbology is usually decided by whatever the software defaults to, and then discovered to be wrong when a retailer, carrier or regulator rejects the labels. Choosing deliberately takes a few minutes and avoids a relabelling exercise.

This guide covers the symbologies that actually appear in enterprise use, what each is for, and how to decide.

Linear and 2D: the fundamental split

Linear barcodes — the familiar bars and spaces — encode data in one dimension. They are wide relative to the data they hold, and they need to be scanned across their width.

2D codes encode data in a grid, both horizontally and vertically. They hold far more data in far less space, can be read at any orientation, and include error correction that lets them decode even when partly damaged.

The practical consequence for hardware: a laser scanner reads linear codes only. A 2D area imager reads both, plus codes displayed on screens. That is why every scanner worth buying today is a 2D imager.

Code 128: the workhorse

The most widely used linear symbology in logistics and general enterprise labelling.

It encodes the full ASCII character set, is compact for a linear code, and includes a check digit. It handles variable-length data, which makes it flexible for part numbers, serials, batch codes and internal references.

If you are labelling internally and nobody has specified a symbology, Code 128 is the sensible default.

GS1-128: Code 128 with rules

This is where symbology stops being a technical choice and becomes a compliance one.

GS1-128 uses Code 128 encoding, but adds a structure: application identifiers. These are standardised prefixes that declare what the following data means — a GTIN, a batch number, an expiry date, a serial, a weight, a shipment reference.

Because the meaning is declared rather than assumed, any system that understands GS1 can parse the code without prior agreement about the format. That is what makes it work across supply chains between companies that have never spoken.

Retailers, distributors and carriers frequently mandate GS1-128 on shipping and carton labels. If you are supplying into a large retailer or shipping through a carrier with labelling requirements, this is usually not optional — and getting it wrong means rejected deliveries rather than just unreadable labels.

Check the requirement before designing the label, not after the first shipment.

UPC and EAN: retail point of sale

Fixed-length product identification codes: UPC predominantly in North America, EAN internationally.

These identify a product at checkout and are issued through GS1 rather than generated internally. You cannot invent one — the number belongs to a registered company prefix.

If you are selling through retail, this is the code on the product. If you are labelling internally, it is not what you want.

Code 39: legacy but persistent

One of the oldest symbologies still in regular use. It encodes uppercase letters, digits and a few symbols, and it is notably less compact than Code 128 — the same data takes noticeably more label width.

It survives because older systems, particularly in government, defence, automotive and healthcare, were built around it and continue to specify it. If a system requires Code 39, use it. For a new deployment with no such requirement, Code 128 is the better choice.

Data Matrix: small items and direct marking

The 2D code of choice where space is severely limited.

Data Matrix holds a useful amount of data in a very small square and includes strong error correction, so it decodes reliably even when partly damaged or poorly printed. That combination makes it the standard for marking electronic components, surgical instruments, small pharmaceutical packaging and anything where a linear code simply will not fit.

It is also the usual choice for direct part marking — codes etched, dot-peened or laser-marked onto metal rather than printed on a label. Reading those requires DPM optics specifically, since there is no printed contrast to work with. See the Datalogic PowerScan PD9630.

One practical note: Data Matrix is frequently disabled by default on scanners. If small square codes are not reading while everything else works, check the symbology is enabled before assuming a hardware problem.

QR codes: customer-facing

Widely recognised because consumers scan them with phones. They hold a lot of data, tolerate damage well, and are read at any orientation.

In enterprise use they appear on customer-facing material, mobile ticketing, payment codes and loyalty schemes rather than on internal labelling, where Data Matrix is usually more space-efficient.

The hardware point matters here: QR codes presented on a phone screen require a 2D imager. A laser scanner will never read them, and that failure is silent — the customer holds up a phone and nothing happens.

PDF417: identity and transport documents

A stacked linear symbology that holds substantial data, including the ability to encode an entire record rather than a reference to one.

It appears on driving licences, identity documents, boarding passes and some shipping documentation. Most enterprise users encounter it because they need to read it rather than print it, so the relevant question is whether your scanner supports it — and like Data Matrix, it is sometimes disabled by default.

GS1 DataBar: small retail items

Designed for products too small for a full UPC or EAN, and for fresh produce and coupons where additional data such as weight or expiry needs to travel with the code.

It is common at retail point of sale and, like the other less-standard symbologies, is frequently disabled on scanners out of the box. Retail deployments that cannot read produce labels or coupons are usually hitting exactly this.

Choosing without guessing

Ask in this order.

Has someone specified it? A retailer, carrier, regulator or existing system requirement overrides everything else. Check before designing the label.

Does the code leave your organisation? If it does, you likely need a GS1 standard — GS1-128 for shipping and cartons, UPC or EAN for retail products.

How much space is there? If a linear code will not fit legibly, use Data Matrix.

Will it be printed on a label or marked onto the item? Direct marking means Data Matrix and DPM-capable scanners.

Otherwise: Code 128 for internal linear labelling, Data Matrix for internal 2D.

Printing and reading it properly

Two hardware points that determine whether the code works regardless of symbology.

Resolution. Dense 2D codes printed at 203 dpi may not render accurately enough to scan reliably. Small Data Matrix codes generally need 300 dpi or higher. Our printer guide covers resolution selection.

Quiet zones. Every symbology requires clear space around the code. A code printed too close to the label edge or crowded by text will fail to decode even when perfectly printed. This is one of the most common causes of labels that will not scan — see our troubleshooting guide.

Common questions

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

They use the same encoding, but GS1-128 adds application identifiers — standardised prefixes declaring what each piece of data means. That lets any GS1-aware system parse the code without prior agreement, which is why retailers and carriers mandate it on shipping labels.

Which symbology should I use for internal labelling?

Code 128 for linear codes — it encodes full ASCII, handles variable-length data and is compact. Data Matrix where space is limited. Use a GS1 standard only if the code leaves your organisation.

Why will my scanner not read Data Matrix or GS1 DataBar?

Both are frequently disabled by default. Scanners ship with common symbologies enabled and less common ones off, because leaving everything on slows decoding. Scanning a configuration barcode from the manufacturer’s programming guide enables them.

Can I create my own UPC codes?

No. UPC and EAN numbers are issued through GS1 against a registered company prefix. For internal labelling you do not need them — use Code 128 or Data Matrix instead.

What is direct part marking?

A code etched, dot-peened or laser-marked directly onto metal or plastic rather than printed on a label, usually Data Matrix. Reading it needs DPM-specific optics, because there is no printed contrast for standard optics to work with.

Do I need 300 dpi to print 2D codes?

For small dense codes, generally yes. A 203 dpi printer may not render a small Data Matrix accurately enough to scan reliably. Large 2D codes print fine at 203 dpi. Also check quiet zones, since crowding the code prevents decoding regardless of resolution.

Tell us what the label has to carry and who has to read it, and we will confirm the symbology, printer resolution and scanner optics together.

Sarah Jane

Sarah Jane

Senior IT Hardware Specialist · TechSellerUSA
Sarah helps businesses and IT teams source the right enterprise hardware at wholesale prices. View profile →