Skip to content
barcoder

Standards/code-128

Code 128

Type1D Linear
MentionedIT
Completeness90%high

Overview

Code 128 is a high-density linear (1D) barcode symbology developed by Computer Identics Corporation in 1981 [1, 2]. 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 [1]. Standardised as ISO/IEC 15417:2007 [3]. 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 [4].

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 [1, 2]: 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 [4].

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 [4].

2007 — ISO/IEC 15417: International standardisation as ISO/IEC 15417:2007 [3]. 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 [1, 3, 5]:

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 [1, 5]:

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 [1]. 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 [4]:

  • 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 [1, 4]:

  • 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 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 or 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 [1, 4]:

  • 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 [6]:

  • Java + many portszxing/zxing — 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.
  • Pythonpython-barcode, treepoem, pylibdmtx/pyzbar (decode).
  • PHPpicqer/php-barcode-generator, picqer/php-barcode-image-renderer.
  • JavaScriptJsBarcode, bwip-js (browser + Node.js).
  • C# / .NETZXing.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:

Comparison

vs. 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 (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 [data-matrix-ref, 4].

vs. ean-13 / 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 — 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 (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 [1, 4]. 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 [1] — 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 [1] 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 [1]. 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 [1, 3, 4]:

  • 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, 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. Code 128 — Wikipedia
  2. Code 128 Barcode Standard guide — UtilityBox
  3. ISO/IEC 15417:2007 — Code 128 specification
  4. GS1-128 — GS1 standards
  5. Code 128 symbology guide — Seagull Scientific BarTender
  6. zxing/zxing — GitHub
  7. Code 128 — Weber Marking
  8. Code 128 complete guide — Barcode Scanner Online

Deployments

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

Regions / aggregations not mapped to a single country

  • Universal
source · docs/standards/code-128/index.md