# Code 128

> Source: https://docs.barcoder.ai/docs/standards/code-128
> research date 2026-05-29 · extracted at 2026-10-06
> Publisher: Barcoder — encyclopedia of QR, barcode and payment-code standards

Specifications:
- [ISO/IEC 15417:2007 — Code 128 bar code symbology specification](https://www.iso.org/standard/43896.html)
- [Code 128 — Wikipedia](https://en.wikipedia.org/wiki/Code_128)
- [GS1-128 — GS1 General Specifications](https://www.gs1.org/standards/barcodes/gs1-128)

## Overview

**Code 128** is a high-density linear (1D) barcode symbology developed by **Computer Identics Corporation in 1981** <sup>[1][1], [2][2]</sup>. It is named for its ability to encode all **128 ASCII characters** (numbers, uppercase and lowercase letters, symbols, and ASCII control codes), using three character subsets (A, B, C) that can be switched within a single barcode for optimum density <sup>[1][1]</sup>. Standardised as **ISO/IEC 15417:2007** <sup>[3][3]</sup>. The GS1-managed variant **GS1-128** (formerly UCC/EAN-128) is **the global standard for supply chain shipping and packaging** identification — pallet labels, shipping cartons, healthcare logistics all use GS1-128 <sup>[4][4]</sup>.

Despite being a 1D symbology in a 2D world, Code 128 remains **the dominant supply-chain barcode** because it efficiently encodes the alphanumeric Application Identifier (AI) data structure that GS1 standardised for logistics, and because every existing supply-chain scanner reads it.

## History

**1981 — Invention by Computer Identics Corporation** <sup>[1][1], [2][2]</sup>: Code 128 was developed to address a gap in 1D barcode capability — earlier symbologies like Code 39 had limited character sets (uppercase + digits + 7 symbols only) and low density. Code 128 added lowercase letters, full ASCII control characters, and significantly higher data density via Subset C's two-digits-per-codeword encoding.

**1989 — UCC/EAN-128 publication**: The **Uniform Code Council (UCC)** (US side) and **European Article Number (EAN)** (European / international side) jointly published a profile of Code 128 with structured data fields for supply chain use — the **UCC/EAN-128** standard. This profile defined how to encode GS1 Application Identifiers (GTIN, batch numbers, dates, weights, etc.) inside a Code 128 symbol <sup>[4][4]</sup>.

**2005 — Rebrand to GS1-128**: When UCC and EAN merged into **GS1** (Global Standards 1) in 2005, UCC/EAN-128 was renamed **GS1-128**. The technical specification remained unchanged — only the name and governance changed <sup>[4][4]</sup>.

**2007 — ISO/IEC 15417**: International standardisation as **ISO/IEC 15417:2007** <sup>[3][3]</sup>. The standard formalises the bar/space patterns, encoding rules, dimensions, decoding algorithms, and application parameters.

## Technical specification

Code 128 is a **high-density 1D linear symbology** with structured character-set switching <sup>[1][1], [3][3], [5][5]</sup>:

| Parameter | Value |
|---|---|
| Symbology family | 1D linear |
| Character set | All 128 ASCII characters |
| Subsets | A (uppercase + digits + control), B (uppercase + lowercase + digits + symbols), C (paired digits 00–99 for high density) |
| Bars + spaces per character | 3 bars + 3 spaces (in 11 modules) |
| Stop pattern | 4 bars + 3 spaces (13 modules) |
| Module width | Configurable (typically 0.25 mm minimum for printing) |
| Variable length | Yes — no fixed code length |
| Error detection | Check digit (modulo-103) |
| Quiet zone | 10 × module width on each side (minimum) |
| Bidirectional reading | Yes (start/stop patterns are asymmetric) |

**Three character subsets** <sup>[1][1], [5][5]</sup>:

| Subset | Characters | Best for |
|---|---|---|
| **A** | Uppercase A–Z, digits 0–9, ASCII control codes 00–31 + DEL, all standard symbols | Legacy data with control characters |
| **B** | Uppercase A–Z, lowercase a–z, digits 0–9, common symbols | Mixed-case alphanumeric text |
| **C** | Pairs of digits 00–99 encoded as single codewords | High-density numeric data |

**Density advantage of Subset C**: A Code 128 in Subset C encodes 14 numeric digits in about 1 inch (25 mm) of printable width — roughly **twice the density of UPC-A or Code 39** for numeric-only data <sup>[1][1]</sup>. This is why Code 128 became the supply-chain standard: shipping container serial numbers and SSCC codes are numeric, and Subset C packs them densely.

**Character set switching**: Special FNC1, FNC2, FNC3, FNC4 codewords and Code A/B/C swap codes allow switching subsets mid-symbol — encoding an alphanumeric prefix in Subset B followed by a long numeric tail in Subset C, all in one symbol.

**GS1-128 profile** <sup>[4][4]</sup>:
- Reserves the **FNC1** codeword as a separator between fields, allowing GS1 Application Identifiers (`(01)` for GTIN, `(17)` for expiry date, `(10)` for batch, `(00)` for SSCC, etc.) to be packed in a single symbol.
- Used on shipping cartons, pallet labels (SSCC), pharmaceutical-distribution outer packaging, healthcare logistics.
- **Multi-line GS1-128 labels** are common — one barcode per row, multiple AIs per label.

## Use cases

Code 128 is the dominant 1D symbology for **supply chain, logistics, and high-density alphanumeric encoding** <sup>[1][1], [4][4]</sup>:

- **Shipping cartons and pallets (GS1-128)** — every commercial pallet shipped with an SSCC (Serial Shipping Container Code) has a GS1-128 label. This is the **largest single deployment of any barcode** by ongoing label-print volume worldwide.
- **Pharmaceutical distribution outer packaging** — bulk drug-distribution boxes use GS1-128 alongside [Data Matrix](https://docs.barcoder.ai/docs/standards/data-matrix) on the inner packs.
- **Healthcare** — patient wristbands, specimen labels, medication trays.
- **Shipping waybills** — UPS, FedEx, DHL, and national postal services use Code 128 on shipping labels for tracking numbers, addresses, references (often alongside [PDF417](https://docs.barcoder.ai/docs/standards/pdf417) or [MaxiCode](https://docs.barcoder.ai/docs/standards/maxicode)).
- **Automotive supply chain** — VDA 4994 (German automotive industry) uses Code 128 for parts labelling.
- **Retail backroom logistics** — receiving labels, store-transfer labels, inventory adjustments.
- **Library systems** — book and patron identification.
- **Document tracking** — file folders, case files in legal/medical/government workflows.
- **Event ticketing (numeric serial)** — Code 128 Subset C for high-density numeric ticket serials.

**Why Code 128 dominates these use cases** <sup>[1][1], [4][4]</sup>:
- High alphanumeric density (Subset B for text, Subset C for numbers, switchable in one symbol).
- Universal scanner support (every commercial barcode scanner reads Code 128).
- GS1-128 profile provides structured application-identifier data encoding.
- Bidirectional reading reduces scanning operator burden.
- No royalty restrictions — public-domain symbology.

## Implementations

Code 128 has **universal scanner and generator support** — every barcode library, every commercial scanner, and most printers handle it natively <sup>[6][6]</sup>:

- **Java + many ports** — [zxing/zxing][6] — 34 000★, active 2025. Decodes Code 128 alongside QR, PDF417, Aztec, Data Matrix, and other 1D symbologies.
- **C / C++** — `libzint` (Zint barcode generator) — comprehensive open-source generator including Code 128 and GS1-128.
- **Python** — `python-barcode`, `treepoem`, `pylibdmtx`/`pyzbar` (decode).
- **PHP** — `picqer/php-barcode-generator`, `picqer/php-barcode-image-renderer`.
- **JavaScript** — `JsBarcode`, `bwip-js` (browser + Node.js).
- **C# / .NET** — `ZXing.Net`, `Aspose.BarCode`, `Dynamsoft Barcode Reader` (commercial), system-level Windows Code 128 fonts.
- **Industrial scanners** — every commercial 1D scanner (Cognex, Datalogic, Honeywell, Keyence, Symbol/Zebra, SICK) supports Code 128 natively — historically built around 1D-barcode-reading hardware.
- **Mobile SDKs** — Scanbot, Scandit, Anyline, Dynamsoft, OS-level (iOS AVFoundation, Android CameraX) all decode Code 128.
- **Thermal printers** — Zebra, Honeywell, SATO, TSC, Brother thermal printers used in shipping labels generate Code 128 directly from their command languages (ZPL, EPL, etc.).

**Open standards documentation**:
- [ISO/IEC 15417:2007][3] — the canonical specification.
- [GS1 General Specifications][4] — define GS1-128 profile and Application Identifiers.

## Comparison

**vs. [Code 39](https://docs.barcoder.ai/docs/standards/code-39)** — Code 39 is the older (1974) alphanumeric 1D symbology with a limited character set (43 characters: uppercase, digits, 7 symbols). Code 128 supplanted Code 39 for new applications in the 1980s–90s because of its full ASCII support, ~30 % higher density, and bidirectional reading. Code 39 still exists in legacy defence and automotive applications.

**vs. [Data Matrix](https://docs.barcoder.ai/docs/standards/data-matrix) (GS1 DataMatrix specifically)** — GS1 DataMatrix encodes the same GS1 Application Identifier structure as GS1-128, but in a 2D matrix. The 2D version is **smaller** (fits on a single drug-carton face where GS1-128 needs more linear space) but requires a 2D-capable scanner. GS1-128 dominates pallets / outer packaging where horizontal space is plentiful; GS1 DataMatrix dominates retail consumer packaging and pharmaceutical inner packs <sup>[data-matrix-ref], [4][4]</sup>.

**vs. [EAN-13](https://docs.barcoder.ai/docs/standards/ean-13) / [UPC-A](https://docs.barcoder.ai/docs/standards/upc-a)** — EAN-13 and UPC-A are fixed-length numeric-only retail barcodes optimised for product identification at the point of sale. Code 128 is variable-length, full-alphanumeric, optimised for variable-length supply-chain data. Different deployment niches: consumer retail = EAN/UPC; backroom logistics = Code 128 / GS1-128.

**vs. [PDF417](https://docs.barcoder.ai/docs/standards/pdf417)** — Both are alphanumeric / binary capable. PDF417 is 2D (stacked-linear) with much higher capacity (~2 kB); Code 128 is 1D with smaller capacity per symbol (~80 characters practical maximum). PDF417 is used where a single symbol must carry a structured payload (driver's license, boarding pass, HUB3 payment slip); Code 128 is used where a label can carry multiple symbols (shipping pallet with separate barcodes for SSCC, GTIN, destination) [[pdf417-ref]].

**vs. [ITF](https://docs.barcoder.ai/docs/standards/itf) (Interleaved 2 of 5, ITF-14)** — ITF-14 is the GS1 outer-carton variant for 14-digit GTINs only. Code 128 / GS1-128 is more flexible — encodes multiple AIs including weights, dates, batch — but takes more printable space.

## Fun facts

**Code 128 is the most-printed barcode in the world by ongoing label volume**, even in 2026 <sup>[1][1], [4][4]</sup>. Every pallet shipped commercially, every shipping carton with an SSCC, every healthcare wristband, every pharma distribution outer pack carries a Code 128 / GS1-128 symbol. Estimates put this at billions of symbols printed per day globally. Despite the QR Code's consumer-facing dominance, Code 128's industrial / logistics dominance is structurally larger by physical-printout count.

The **"128" in the name refers to the 128 ASCII characters** Code 128 can encode <sup>[1][1]</sup> — not, as sometimes assumed, to a code length or scan rate. This makes Code 128's name self-describing in a way that few other barcode symbologies' names are.

**Subset C's 2-digits-per-codeword encoding** <sup>[1][1]</sup> was the structural innovation that gave Code 128 its supply-chain dominance. Earlier symbologies (Code 39 in particular) encoded one numeric digit per codeword; Code 128 encodes pairs. The result is that a 14-digit GTIN takes about half the printable width in Code 128 (Subset C) vs Code 39. At billions of pallet labels per year, that printing-cost saving is substantial.

The **subset-switching mechanism** — using special Code-A, Code-B, Code-C, and FNC1 codewords to swap encoding modes mid-symbol — let Code 128 encode a typical SSCC + GTIN + batch + expiry payload (mixed alphanumeric and numeric) in a single bidirectional 1D barcode <sup>[1][1]</sup>. This compact-and-structured property is why GS1 built its supply-chain standard around Code 128 rather than around then-newer 2D alternatives.

## Status

**Active, dominant, foundational** <sup>[1][1], [3][3], [4][4]</sup>:

- **ISO/IEC 15417:2007** is the current spec
- **GS1-128** is the canonical supply-chain barcode profile globally
- **Universal scanner support** across every industrial scanner and consumer mobile SDK
- **Public domain** — no licensing fees

**Strategic context**:
- 2D successors ([Data Matrix](https://docs.barcoder.ai/docs/standards/data-matrix), [QR Code](https://docs.barcoder.ai/docs/standards/qr-code)) are encroaching on some Code 128 use cases (especially pharmaceutical inner packaging and consumer-facing retail), but Code 128's grip on the **shipping carton + pallet label + healthcare wristband** category remains unchallenged.
- GS1 continues to maintain GS1-128 as a parallel standard alongside GS1 DataMatrix for supply chain — both are used, with the choice driven by available label space and existing scanner infrastructure.
- No deprecation planned; ISO 15417:2007 has been stable for nearly two decades and shows no signs of needing major revision.

## Sources

[1]: https://en.wikipedia.org/wiki/Code_128
[2]: https://barcode.myutilitybox.com/code-128-barcode-generator
[3]: https://www.iso.org/standard/43896.html
[4]: https://www.gs1.org/standards/barcodes/gs1-128
[5]: https://barcodeguide.seagullscientific.com/content/Symbologies/Code_128.htm
[6]: https://github.com/zxing/zxing
[7]: https://www.weber-marking.com/expertise/know-how/glossary/code-128/
[8]: https://barcodescanner.online/barcode-wiki/code128-complete-guide/
[data-matrix-ref]: https://docs.barcoder.ai/source/standards/data-matrix
[pdf417-ref]: https://docs.barcoder.ai/source/standards/pdf417

1. [Code 128 — Wikipedia][1]
2. [Code 128 Barcode Standard guide — UtilityBox][2]
3. [ISO/IEC 15417:2007 — Code 128 specification][3]
4. [GS1-128 — GS1 standards][4]
5. [Code 128 symbology guide — Seagull Scientific BarTender][5]
6. [zxing/zxing — GitHub][6]
7. [Code 128 — Weber Marking][7]
8. [Code 128 complete guide — Barcode Scanner Online][8]

## Deployments

Found in the following country reports (grep across `reports/countries/`):

- **FI** — [FI-finland.md](https://docs.barcoder.ai/docs/payments/FI)
- **IT** — [IT-italy.md](https://docs.barcoder.ai/docs/payments/IT)

## Regions / aggregations not mapped to a single country

- Universal
