Skip to content
barcoder

Standards/code-39

Code 39

Type1D Linear
Completeness90%high

Overview

Code 39 is a 1D alphanumeric linear barcode symbology developed in 1974 by David Allais and Ray Stevens at Intermec [1, 2]. It was the first widely adopted barcode capable of encoding alphabetic characters (in addition to digits) — a structural breakthrough that earlier symbologies like upc-a (numeric-only) couldn't match. Code 39 is named for its original encoding rule: 3 of every 9 elements are wide (the other 6 are narrow), producing the binary patterns for each character.

Standardised as ISO/IEC 16388 [3], Code 39 became the US Department of Defense LOGMARS standard for military equipment marking and the automotive industry's preferred 1D symbology for parts identification [4, 1]. It is public domain with no licensing requirements [1]. Although newer symbologies like code-128 are denser and more capable, Code 39 remains in active use in defence, automotive, healthcare, and library systems where its simplicity, robustness, and 50-year legacy compatibility outweigh its density limitations.

History

Background (early 1970s) — Retail had upc-a (1973/1974) for numeric product identification, but industrial, defence, and automotive contexts needed barcode encoding for alphanumeric part numbers (e.g., Boeing's aircraft-component identifiers contained both letters and digits, and existing symbologies couldn't handle them) [1, 2].

19 December 1974 — The Boeing meeting that birthed Code 39 [2]: David Allais and Ray Stevens of Intermec met with representatives of The Boeing Company in Intermec's office in Mountlake Terrace, WA. Boeing explained that they could not use existing barcode standards because their part numbers contained both letters and numbers. Allais and Stevens went to work designing an alphanumeric barcode in response.

1974 — Code 39 specification published [1, 2]: Code 39 became the first barcode symbology to encode the 26 uppercase letters A–Z, digits 0–9, and 7 special symbols in a single 43-character set.

US Department of Defense LOGMARS adoption (early 1980s) [1, 4]: The DoD standardised on Code 39 for inbound material marking under the LOGMARS (Logistics Applications of Automated Marking and Reading Symbols) programme. This made Code 39 the canonical military-equipment-marking barcode worldwide for decades — and continues today on US military assets and equipment.

Automotive industry adoption (mid-1980s) [1]: Within ~2 years of Code 39's introduction, US automotive companies adopted it for parts identification. VDA 4994 (the German automotive industry's parts-labelling standard) also adopted Code 39 alongside code-128 for parts that needed alphabetical encoding.

1980s — Full ASCII extension [1]: A "Full ASCII" variant of Code 39 was developed that uses 2-character pairs to encode the full ASCII set (128 characters) beyond Code 39's native 43. Lowercase letters, additional punctuation, and ASCII control characters can be encoded by combining a shift character (+, /, %, $) with a Code 39 letter. This kept Code 39 relevant when applications needed mixed-case text.

ISO/IEC 16388:2007 — formal international standardisation [3]. The standard formalises the bar-and-space patterns, encoding rules, dimensions, decoding algorithm, and application parameters.

Technical specification

Code 39 is a 1D linear alphanumeric symbology with a fixed 9-element-per-character pattern [1, 3, 5]:

Parameter Value
Symbology family 1D linear
Character set (Native) 43 characters: A–Z, 0–9, space, - . $ / + %
Character set (Full ASCII) 128 ASCII characters via shift sequences
Elements per character 9 — 5 bars + 4 spaces
Wide elements per character 3 of 9 (the "3 of 9" naming origin)
Bar widths Two — narrow and wide
Wide-to-narrow ratio Configurable (typically 2:1 or 3:1)
Start/Stop character * (asterisk) — required on both ends
Length Variable (no fixed number of digits)
Quiet zone 10 × narrow-element width on each side
Check digit Optional (modulo-43); rarely used
Bidirectional reading Yes

Native 43-character set [5]:

0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z space - . $ / + %

Density limitation: Code 39 averages ~13.7 modules per character (compared to code-128's ~5.5 modules per character with Subset C). For a long numeric string, Code 39 is ~2.5x wider than Code 128 — which is why Code 128 displaced Code 39 in supply-chain applications where density matters [1, code-128-ref].

Self-checking property [1, 5]: Code 39's "3 of 9" structure (exactly 3 wide elements per character) provides inherent error detection — any printing or scanning error that alters one element changes the wide-element count away from 3, instantly flagging the symbol as invalid. This is why most Code 39 deployments don't bother with a check digit — the symbology itself self-checks at a per-character level.

Full ASCII Code 39 shift characters [1]:

  • $ = control character shift
  • % = miscellaneous shift
  • / = punctuation shift
  • + = lowercase letter shift

Use cases

Code 39's primary niches in 2026 are defence, automotive, healthcare, and library applications where legacy installed-base, alphanumeric capability, and self-checking robustness matter more than density [1, 4]:

  • US Department of Defense (LOGMARS) — every piece of US military equipment inbound to a depot carries Code 39 marking per the LOGMARS standard. The legacy install base spans 40+ years of DoD assets [4].
  • Automotive parts identification — parts labels, build sheets, warranty tracking. VDA 4994 (German automotive) uses Code 39 alongside code-128 for alphabetical part numbers [1].
  • Healthcare — patient wristbands and specimen labels — many hospital systems use Code 39 for patient identification because of its robust self-checking and the staff familiarity / hardware-compatibility heritage.
  • Library catalogue systems — book labels, patron ID cards. Many library systems standardised on Code 39 in the 1980s–90s and have not migrated.
  • Industrial inventory and asset tracking — equipment serialisation in manufacturing, oil/gas, utilities, electrical-distribution warehouses.
  • Government IDs and badges — many US federal agency employee ID cards carry Code 39 on the back encoding employee number.
  • Aerospace — aircraft parts and maintenance documentation alongside data-matrix for newer direct-part marking.
  • Postal services — internal sorting labels (alongside code-128).
  • Document management — file folder labels, case files, archival materials.

Why Code 39 persists [1]:

  • Universal scanner support — every 1D scanner ever made reads Code 39.
  • Self-checking — operational robustness at the per-character level.
  • Public domain — no licensing fees.
  • Legacy install base — billions of existing Code 39 labels in operational systems would have to be migrated for any replacement to fully displace it.

Why Code 39 is being displaced [1, code-128-ref]:

  • code-128's higher density (~2.5x more dense for numeric data) is structurally important for any new application where label space matters.
  • 2D successors (data-matrix, qr-code) carry vastly more data in smaller footprints.

Implementations

Code 39 has universal scanner and library support — older than nearly every other symbology in active use [6]:

  • Java + many portszxing/zxing — 34 000★, active 2025. Decodes Code 39 alongside Code 128, UPC, EAN, QR, etc.
  • C / C++libzint (generator); zbar (decoder).
  • Pythonpython-barcode, treepoem, pyzbar.
  • PHPpicqer/php-barcode-generator.
  • JavaScriptJsBarcode, bwip-js.
  • C# / .NETZXing.Net, Aspose.BarCode, Dynamsoft Barcode Reader (commercial).
  • OS-level mobile — iOS AVFoundation, Android CameraX / ML Kit all decode Code 39 natively.
  • POS / industrial scanners — every commercial 1D scanner reads Code 39 (NCR, Datalogic, Honeywell, Symbol/Zebra, Cognex, Diebold).
  • Mobile SDKs — Scanbot, Scandit, Anyline, Dynamsoft.
  • Thermal printer firmware — Zebra, Honeywell, SATO, TSC, Brother all support Code 39 directly from their command languages (ZPL, EPL, etc.).
  • Windows / Office fonts — Code 39 fonts (Free 3 of 9, etc.) are pre-installed on many office systems and can generate Code 39 directly from text by surrounding with * start/stop characters.

Reference documentation [3, 1]:

Comparison

vs. code-128 — Direct successor; Code 128 displaced Code 39 for most new applications from the 1980s onwards. Code 128's three character subsets (A, B, C) provide full ASCII (lowercase included natively), and Subset C's two-digits-per-codeword encoding makes Code 128 ~2.5x denser than Code 39 for numeric data. Code 39 persists in legacy install bases (DoD LOGMARS, automotive, library) but new applications generally choose Code 128 [code-128-ref].

vs. upc-a / ean-13 — Different deployment niche. UPC/EAN are numeric-only fixed-length retail product identifiers scanned at supermarket POS; Code 39 is variable-length alphanumeric for industrial / military / library use. Code 39 doesn't compete with UPC/EAN; they serve different purposes [upc-a-ref, ean-13-ref].

vs. itf (Interleaved 2 of 5) — Both 1D, both bidirectional. ITF is numeric-only and even-number-of-digits-only, used primarily on shipping cartons (ITF-14 specifically). Code 39 is alphanumeric and variable-length. Different deployment niches; coexist in supply-chain applications [itf-ref].

vs. data-matrix — Different generations. Data Matrix (1987) is a 2D successor that fits roughly the same data as a Code 39 symbol in a much smaller footprint, and tolerates 30 % damage. Modern aerospace direct-part marking (DPM) increasingly uses Data Matrix where Code 39 was historically used for the small-footprint advantage. Code 39 hasn't been displaced where the label is paper or where the legacy scanner base must continue working [data-matrix-ref].

Fun facts

Code 39 was born in a meeting room in Mountlake Terrace, WA, on 19 December 1974, because Boeing needed alphanumeric part-number barcoding and no existing symbology supported it [2]. The specific Boeing requirement that drove Code 39's design — part numbers like A1234B-X that mixed letters and digits — became the structural reason every aerospace, defence, and automotive industry barcode-marking decision for the next decade chose Code 39 as the default.

"3 of 9" — the naming origin [1, 5]: every Code 39 character uses 9 elements (5 bars + 4 spaces), of which exactly 3 are wide. The naming captures the structural self-checking property — any decoded character that doesn't have exactly 3 wide elements is invalid by construction. This is why Code 39 is also sometimes called "3 of 9 Code" or "Type 39".

The asterisk (*) as start and stop character [1, 5] is a Code 39 convention that has odd consequences: when generating Code 39 barcodes from text, the user surrounds their string with * characters — meaning the original * cannot itself be encoded as data inside a standard Code 39 barcode without using the Full ASCII shift mechanism. This is the kind of standards-design quirk that becomes load-bearing legacy.

The US Department of Defense's LOGMARS standardisation on Code 39 in the early 1980s [4, 1] essentially locked in Code 39 as the canonical military-equipment-marking barcode for the entire NATO sphere. Every contractor supplying the DoD has to support Code 39 on inbound material; this propagates Code 39 through the supply chain across decades and prevents wholesale migration to denser alternatives.

David Allais (Code 39's inventor) went on to invent or co-invent multiple other barcode symbologies including code-128 (1981) [1, 7]. His designs collectively dominate the 1D barcode landscape — Code 39 for legacy alphanumeric applications, Code 128 for modern dense alphanumeric and supply chain. The "AIDC Founders" recognition lists Allais among a small handful of individuals whose technical decisions shaped the global retail and industrial barcoding infrastructure.

Status

Active, legacy-supported, slowly being displaced [1, 3]:

  • ISO/IEC 16388:2007 is the current spec — stable for nearly 20 years
  • Universal scanner support continues
  • Public domain — no licensing fees
  • Active in legacy niches: DoD LOGMARS, automotive parts, healthcare wristbands, library systems, government IDs

Strategic trajectory:

  • New applications increasingly choose code-128 for density, or data-matrix for small footprint with damage tolerance.
  • Legacy installed base of billions of Code 39 labels and scanners is too large to migrate wholesale — Code 39 will remain in active use for decades.
  • No deprecation planned; ISO/IEC continues to maintain the standard for the installed-base support requirement.

The structural pattern: Code 39 is a 50-year-old foundational standard that survives by virtue of installed base and self-checking robustness, even as more capable successors handle new application categories.

Sources

  1. Code 39 — Wikipedia
  2. Raising the Bar — Interview with David Allais
  3. ISO/IEC 16388:2007 — Code 39 specification
  4. History of Barcode Technology — A2B Tracking
  5. Code 39 symbology guide — Seagull Scientific BarTender
  6. zxing/zxing — GitHub
  7. David Allais — Wikipedia
  8. Code 39 history, advantages, limitations — ByteScout

Deployments

No country reports mention this standard by name.

Regions / aggregations not mapped to a single country

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