Code 39 Barcodes: A Technical Deep Dive Into the Iconic 'Code 3 of 9' |
Chapter 1: Introduction to Code 39 |
Code 39 (also called Code 3 of 9) is one of the earliest alphanumeric barcode symbologies. Invented in 1974, it remains a milestone in automatic identification. |
Chapter 2: The Birth of Code 39 |
Developed by David Allais and Ray Stevens of Intermec, it was designed to meet the U.S. Department of Defense's need for a simple, high-tolerance barcode. |
Chapter 3: Why 'Code 39' |
The name comes from its structure: each character encodes 9 elements (5 bars and 4 spaces), of which exactly 3 are wide --- hence '3 of 9.' |

|
Chapter 4: The Character Set |
Code 39 encodes 43 characters: digits 0-9, uppercase A-Z, and symbols like -, ., $, /, +, %, and space. It does not support lowercase letters directly. |
Chapter 5: The Start and Stop Asterisk (*) |
Every Code 39 barcode begins and ends with an asterisk (*). This is the only mandated start/stop character and is never used as data. |
Chapter 6: Encoding Mechanism - Bars and Spaces |
Each character consists of 5 bars and 4 spaces. Wide elements are typically 2-3 times the width of narrow elements. The pattern of wide/narrow determines the value. |

|
Chapter 7: The 9-Element Pattern |
With 9 total elements and exactly 3 wide, the theoretical number of combinations is C(9,3)=84, but only 43 are used for data, plus the asterisk. |
Chapter 8: Self-Checking Property |
Code 39 is inherently self-checking. Because each character has a fixed number of wide elements, any missing or extra wide element immediately flags an error. |
Chapter 9: No Checksum Required |
Unlike many later symbologies, Code 39 does not require a mandatory checksum. An optional modulo-43 checksum can be added but is rarely used in practice. |

|
Chapter 10: The Beauty of 'Font-Based' Barcoding |
One of Code 39's most famous features: you can create a valid barcode using only a system font file --- no special barcode generation software required. |
Chapter 11: How a Font Creates a Barcode |
A barcode font maps each keyboard character (e.g., 'A') to a specific glyph that contains the correct wide/narrow bar pattern for that character. |
Chapter 12: The Typographic Trick |
When you type '*CODE39*' in a Code 39 font, the font renders the start asterisk, each data character's bar pattern, and the stop asterisk --- all as printable text. |

|
Chapter 13: No Software Logic Needed |
Because the encoding logic is embedded entirely in the font's glyph shapes, any application that can change fonts (Word, Notepad, Excel) can produce a scannable barcode. |
Chapter 14: The Limitation of Font-Based Approach |
The font cannot adjust the narrow-to-wide ratio dynamically. You must manually set font size and ensure the printer's resolution is sufficient for the narrow bar width. |
Chapter 15: Why Data Density Is Low - The Core Reason |
Each character uses 9 elements. Compare to Code 128, which uses 11 elements for 2 characters (variable width), Code 39 encodes only 1 character per 9 elements --- very inefficient. |

|
Chapter 16: The Wide-to-Narrow Ratio Penalty |
To be readable, the wide bar must be at least 2* the narrow. This forces large physical spaces between bars, further reducing density. |
Chapter 17: The Space Between Characters |
Code 39 uses an inter-character gap (a narrow space) between each character, adding extra length that many modern symbologies avoid. |
Chapter 18: Typical Data Density Figure |
At a moderate X-dimension (narrow bar width) of 0.25 mm, Code 39 encodes roughly 2-3 characters per centimeter --- about half the density of Code 128. |

|
Chapter 19: The Minimum Length Problem |
Even a single digit (e.g., '5') requires 3 asterisks + 1 data char = 4 characters' worth of bars, making short codes surprisingly long. |
Chapter 20: Early Adoption - The Automotive Industry |
In the late 1970s, General Motors used Code 39 to track subassemblies on production lines, replacing handwritten logs. |
Chapter 21: The Defense Logistics Agency (DLA) |
The U.S. military mandated Code 39 for all supplied parts in 1981 under the LOGMARS program --- one of the largest early deployments. |

|
Chapter 22: Automotive Supplier Chains |
Ford and Chrysler required their tier-1 suppliers to label engine blocks and transmissions with Code 39, enabling just-in-time inventory. |
Chapter 23: The Electronics Industry |
IBM and HP used Code 39 on circuit boards and component reels to track batch numbers and revision levels throughout assembly. |
Chapter 24: Hospital and Laboratory Use |
In the early 1980s, blood banks adopted Code 39 for specimen tubes, patient wristbands, and medication labels --- where alphanumeric data was critical. |

|
Chapter 25: Library Systems |
Many university libraries used Code 39 on book spines and borrower cards, as it could encode both letters and numbers for call numbers. |
Chapter 26: Retail - The Missed Opportunity |
Unlike UPC, Code 39 was never adopted for point-of-sale due to its low density --- it couldn't fit a 12-digit product code on a small gum package. |
Chapter 27: Industrial Work-in-Process Tracking |
Factories printed Code 39 on paper travelers (routing sheets) to track metal castings through heat treatment, machining, and painting. |

|
Chapter 28: Aerospace Applications |
Boeing and Airbus used Code 39 for part numbering on rivets, panels, and wiring harnesses, where durability and simplicity outweighed density. |
Chapter 29: Government Property Management |
The U.S. GSA (General Services Administration) labeled office furniture and IT equipment with Code 39 for asset inventory audits. |
Chapter 30: The Postal and Parcel Sector |
Some regional couriers used Code 39 on shipping labels for destination sorting, though it was later replaced by postal-specific symbologies. |

|
Chapter 31: Pharmaceutical Batch Records |
Drug manufacturers printed Code 39 on bulk chemical containers to encode lot numbers, expiration dates, and potency --- all in one linear symbol. |
Chapter 32: Advantages - Simplicity |
The encoding rules are so simple that a child can decode them with a ruler --- no complex lookup tables for variable-length patterns. |
Chapter 33: Advantages - Wide Readability Tolerance |
Code 39 can be read with a very wide range of narrow-to-wide ratios (1:2 to 1:3), making it forgiving on low-quality printers. |

|
Chapter 34: Advantages - No Special Scanner Needed |
Any laser scanner or CCD imager that supports linear codes can read Code 39; it was the baseline for most early scanner firmware. |
Chapter 35: Advantages - Alphanumeric Native |
Unlike Interleaved 2 of 5 (numeric only) or UPC (numeric), Code 39 handles letters out-of-the-box --- a huge plus for part numbers. |
Chapter 36: Advantages - Human-Readable Clarity |
The human-readable text below the barcode is exactly the encoded data (with asterisks), making manual entry trivial. |

|
Chapter 37: Advantages - No Checksum Overhead |
For internal systems with error-checking at the database level, the optional checksum can be skipped, saving one character per barcode. |
Chapter 38: Disadvantages - Low Density (Recap) |
As noted, it is one of the least space-efficient symbologies, often requiring labels 2-3* longer than Code 128 for the same data. |
Chapter 39: Disadvantages - No Lowercase or Extended ASCII |
To encode lowercase, you must use Code 39's 'full ASCII' variant --- which uses two-character shifts, doubling length and reducing density further. |

|
Chapter 40: Disadvantages - Poor Print Quality Sensitivity |
While tolerant of ratio variations, it is very sensitive to print gain (spreading of ink), because wide/narrow distinction is binary. |
Chapter 41: Disadvantages - Limited Error Correction |
Without a mandatory checksum, a single misread substitution (e.g., 'B' for '8') can pass undetected in non-checksummed systems. |
Chapter 42: Disadvantages - No Bidirectional Decoding Certainty |
Though scannable from either direction, the lack of a true reversal-protection pattern means some sequences can be mis-decoded when reversed. |

|
Chapter 43: Disadvantages - Wasted Quiet Zone |
Code 39 requires a quiet zone (blank margin) of at least 10* the narrow bar width on each side --- more than most modern codes. |
Chapter 44: The Full ASCII Extension |
By using paired characters ($, /, +, %) as shift codes, Code 39 can represent all 128 ASCII characters, but this triples length for lowercase or control chars. |
Chapter 45: The Optional Modulo-43 Checksum |
This checksum is calculated by summing character values and dividing by 43. It adds one extra character but catches most single transcription errors. |

|
Chapter 46: Why It Remained Popular Despite Flaws |
Because it was free, open, and patent-free from day one, no licensing fees made it the default choice for internal systems in the 1980s. |
Chapter 47: The Rise of Code 128 (1981) |
Code 128 offered higher density, support for all 128 ASCII characters, and dual checksums --- but required licensed encoders initially. |
Chapter 48: The Rise of Interleaved 2 of 5 (I2of5) |
For purely numeric data, I2of5 achieved almost double the density of Code 39 by pairing digits, but it lacked alphanumeric capability. |

|
Chapter 49: The Rise of GS1-128 and UCC/EAN |
Supply chains demanded standardized application identifiers (AI) --- Code 39 had no native support, while Code 128 integrated seamlessly. |
Chapter 50: The Rise of 2D Barcodes (PDF417, Data Matrix, QR) |
Starting in the 1990s, 2D codes encoded hundreds of characters in a tiny space, making Code 39's linear format obsolete for new applications. |
Chapter 51: The Retail POS Blockade |
Retailers standardized on UPC-A and EAN-13, which are shorter and denser for numeric product codes --- Code 39 was never even considered. |

|
Chapter 52: The Healthcare Shift to GS1 DataMatrix |
Hospitals moved to 2D barcodes for surgical instruments and implants, as they could encode UDI (Unique Device Identification) in a small footprint. |
Chapter 53: The Automotive Industry's Migration |
By 2005, most auto makers required GS1-128 or DataMatrix for traceability, because Code 39 labels couldn't hold enough traceability data (serial + date + batch). |
Chapter 54: The Military's Transition |
The U.S. DoD phased out LOGMARS in favor of MIL-STD-130 using DataMatrix for small items --- Code 39 remained only for legacy spares. |

|
Chapter 55: The Printing Industry's Limitation |
Code 39's long length made it unsuitable for small product packaging, where real estate is premium --- driving adoption of narrower symbologies. |
Chapter 56: The Scanner Technology Evolution |
Modern imagers can read damaged 2D codes with error correction, but Code 39's lack of Reed-Solomon recovery makes it fragile in harsh environments. |
Chapter 57: The Encoding Speed Factor |
Because Code 39 uses bi-level (wide/narrow) encoding, it requires more time for a laser to sweep across --- slowing high-speed sortation conveyors. |

|
Chapter 58: The Font-Based Illusion |
While font-based creation was a boon, it also encouraged poor practices --- users would scale fonts arbitrarily, creating unreadable narrow bars due to aliasing. |
Chapter 59: Legacy-Only Status Today |
As of 2026, Code 39 is still used in warehouses for internal racks, in some government asset tags, and in hobbyist projects --- but rarely for new product lines. |
Chapter 60: Final Verdict - The Honorable Pioneer |
Code 39 is the 'Model T' of barcodes: revolutionary, simple, and durable. But like the Model T, it was superseded by faster, denser, and smarter designs that could carry more data in less space --- a natural evolution in the quest for efficiency. |