What Code 128 Is (and Why It's Everywhere)
Code 128 is a high-density, variable-length linear barcode introduced in 1981. Unlike a UPC or EAN — which only encode a fixed string of digits for retail checkout — Code 128 can encode all 128 ASCII characters: digits, uppercase and lowercase letters, punctuation, and control characters.
That flexibility is why it became the workhorse of logistics, warehousing, and internal inventory. Shipping labels, carton codes, SKU tags, and healthcare labels are overwhelmingly Code 128. If a barcode isn't on a retail shelf and encodes letters as well as numbers, it's very often Code 128.
The Three Subsets: A, B, and C
Code 128 gets its density from three character sets — called subsets — that the symbol can switch between mid-barcode. Each is optimised for a different kind of data:
- Code Set A — uppercase letters, digits, standard punctuation, and ASCII control characters
- Code Set B — uppercase and lowercase letters, digits, and punctuation (the most common general-purpose set)
- Code Set C — pairs of digits (00–99), encoding two numeric digits in a single symbol character for maximum density
Code Set C is why Code 128 is so compact for numeric data: encoding digits two-at-a-time roughly halves the width of a long number compared with formats that encode one character at a time. A good generator picks and switches subsets automatically.
How a Code 128 Symbol Is Built
Every Code 128 barcode follows the same anatomy, and understanding it explains why a few printing rules matter so much:
- 1A quiet zone — blank margin — on the left
- 2A start character that also declares the initial subset (Start A, B, or C)
- 3The encoded data characters
- 4A checksum character calculated modulo 103 over the symbol
- 5A stop character
- 6A quiet zone on the right
The modulo-103 checksum is mandatory and is what makes Code 128 self-checking. You never calculate it by hand — the generator computes and embeds it. Your job is only to keep the quiet zones and print it sharp.
Code 128 vs Code 39: Which Should You Use?
Code 39 is the older alternative you'll still see on asset tags and industrial labels. It's simpler and extremely widely supported, but Code 128 wins on almost every practical measure for modern use:
- Character set — Code 39 encodes 43 characters (uppercase, digits, a few symbols) with no lowercase; Code 128 covers the full ASCII set including lowercase
- Density — Code 128 is significantly more compact, especially for numbers thanks to Code Set C; Code 39 barcodes get long quickly
- Error checking — Code 128 always includes a checksum; Code 39's check character is optional and often omitted
- Legacy support — Code 39 is trivially decoded by very old or cheap scanners, which is its one lingering advantage
For new internal labelling, Code 128 is almost always the better default. Choose Code 39 only if you must support legacy scanners or a system that specifically requires it.
GS1-128: Code 128 for the Supply Chain
GS1-128 (previously called UCC/EAN-128) isn't a different symbology — it's a standardised way of using Code 128. It uses a special FNC1 character followed by Application Identifiers (AIs): short numeric prefixes that tell a system what the data means.
For example, an AI can flag that the following digits are a GTIN, a batch/lot number, an expiry date, or a serial number. That's how a single logistics label on an outer carton can carry the product identity, the batch, and the expiry date in one machine-readable code. If you're printing carton or pallet labels for a distributor, GS1-128 with the correct AIs is usually what they ask for.
GS1-128 is for logistics units — cartons, pallets, shipments — not the retail item scanned at a till. The consumer product still needs a UPC or EAN. Don't put a GS1-128 where a retail POS expects a GTIN barcode.
When to Use Code 128 — and When Not To
Code 128 is the right tool for a wide range of jobs, but not for retail checkout. Use this to decide:
- Use it for internal SKUs, warehouse bins, and inventory labels — any code you control that never hits a retail register
- Use it for shipping and carton labels (often as GS1-128 with Application Identifiers)
- Use it whenever you need to encode letters as well as numbers, or want a compact numeric code
- Do NOT use it as the retail product barcode — for shelf/marketplace scanning you need a UPC-A or EAN-13 GTIN
How to Generate a Code 128 Barcode
Because Code 128 uses your own numbers, a free generator does the whole job end to end — no GS1 licence needed for internal codes.
- 1Open the Barcode Generator and choose Code 128
- 2Type in your SKU or reference — letters and numbers are both fine, and the checksum is added for you
- 3Download a print-ready PNG, or upload an Excel/CSV column of SKUs to bulk-generate the whole set as a ZIP
Bulk Code 128 from a spreadsheet is the fastest way to label a fresh batch of inventory — one column of SKUs in, a ZIP of named barcode images out.