Code 39 Explained

Code 39 is one of the oldest and most widely recognised barcode symbologies still in active use. Developed in 1974 by David Allais and Ray Stevens at Intermec, it was the first alphanumeric barcode to achieve broad adoption. Despite being technically inferior to Code 128 in density and character set, it remains the mandated standard in several industries and is still in widespread use in legacy systems.

Structure and Encoding

Code 39 encodes characters as five bars and four spaces — nine elements per character, of which three are wide (the "39" in the name refers to the three wide elements out of nine). Each character is separated by a narrow inter-character space. The symbol begins and ends with a special start/stop character, asterisk (*), which is not printed in the human-readable text. Scanners use the start/stop pattern to determine the orientation of the scan.

The character set includes: uppercase A–Z (26 characters), digits 0–9 (10 characters), and seven special characters: space, hyphen (-), period (.), dollar sign ($), forward slash (/), plus sign (+), and percent sign (%). That is 43 characters total — no lowercase, no other punctuation. For data that includes lowercase letters or extended characters, you need Code 128 or a 2D symbology.

Optional Checksum

Unlike Code 128, Code 39's check character is optional — not all implementations include it. The checksum is a modulo-43 calculation: assign each character its numeric value (A=10, B=11, ... Z=35, 0=0, 1=1, ..., 9=9, space=36, -=37, .=38, $=39, /=40, +=41, %=42), sum all character values, divide by 43, and take the remainder. The remainder maps back to the Code 39 character set for the check digit.

In industries that mandate Code 39 (see below), the checksum is often required. In legacy systems that read Code 39 without verification, the checksum may be absent. If you are generating Code 39 for a known system, check whether it expects the checksum before including or omitting it.

Data Density vs. Code 128

Code 39 is less dense than Code 128. The same 10-character alphanumeric string produces a Code 39 barcode approximately 40% wider than the equivalent Code 128. For small labels or data-dense applications, this is a significant disadvantage. On a 2″ × 1″ label, Code 39 can encode roughly 8–12 characters comfortably; Code 128 can encode 15–20 characters in the same width.

The density gap is most visible with numeric data. Code 128 Subset C encodes digit pairs (two digits per element group) — for a 12-digit number, Code 128 Subset C produces a barcode about 60% narrower than Code 39.

Minimum Print Size

Code 39 has no GS1-mandated minimum (it is not a GS1 symbology). Practical minimums depend on your scanner and environment. At 300 DPI printing with a standard X-dimension (0.25 mm narrow element), a readable Code 39 barcode requires at least 5 mm bar height for close-range scanning. The symbol width scales with the number of characters — expect 12–15 mm per character at 0.25 mm X-dimension.

Narrow bars at very small X-dimensions are more susceptible to print distortion. For reliable Code 39 printing, use an X-dimension of at least 0.25 mm (10 mils) — the GS1 minimum for Code 128 also serves as a reasonable floor for Code 39. Use the print size guide to calculate your specific requirements.

Industries Where Code 39 Remains Standard

US Department of Defense (DoD): MIL-STD-130 mandates Code 39 for item marking on military equipment, spare parts, and some supply chain labels. This requirement has been in place since the 1980s and persists because of the installed base of Code 39 scanners in military logistics.

Healthcare (legacy systems): HIBCC (Health Industry Business Communications Council) originally based its UPN (Universal Product Number) standard on Code 39. While GS1-128 and DataMatrix have largely replaced it, some hospital supply chain and laboratory systems still require Code 39 for compatibility with legacy equipment.

Automotive: Some automotive supply chain specifications from the 1980s–1990s used Code 39. Most have migrated to Code 128 or 2D, but legacy production lines occasionally still scan Code 39.

When to Use Code 39 vs. Code 128

Use Code 39 when: (1) a specification, trading partner, or regulatory requirement mandates it; (2) you need to integrate with a legacy system already deployed with Code 39 scanners; (3) simplicity is a priority and data is short and uppercase-only.

Use Code 128 in all other cases. It is more compact, supports lowercase and extended characters, and is universally supported by modern scanners. See the Code 128 generator for comparison.

Frequently Asked Questions

Can Code 39 encode lowercase letters?

No. Code 39 supports only uppercase A–Z. For lowercase, use Code 128 Subset B or a 2D symbology. An extension called Code 39 Extended (or Full ASCII Code 39) encodes the full ASCII set by combining Code 39 characters in pairs, but this requires a scanner configured to decode the extension and produces much wider barcodes.

Is Code 39 still supported by modern scanners?

Yes. Every modern barcode scanner and imager — Zebra, Honeywell, Datalogic, and others — supports Code 39 by default. It may be disabled in some scanner configurations for specific applications but is universally available.

Do I need the check digit in Code 39?

Only if the target system requires it. Check whether your WMS, ERP, or scanning system is configured to validate the Code 39 checksum. If it is, omitting the check digit will cause scan errors. If it is not, including it wastes a character's worth of barcode width.

Can I mix Code 39 and Code 128 in the same system?

Yes. Modern scanners read both symbologies and report which was decoded. In a mixed system, ensure the WMS can distinguish between Code 39 and Code 128 values — typically by format (length, character content) or by using a symbology ID prefix.

Generate labels right now — free

The free tool runs entirely in your browser. No account, no uploads.

    More small-business tools: PromptedPaperwork