Code 128 and Code 39 are both 1D (one-dimensional, single-row) linear barcodes, but Code 128 encodes more characters per inch, supports the full 128-character ASCII set, and produces a physically shorter barcode for the same data. Code 39 uses a simpler, older encoding that most scanners read without configuration and that certain regulated industries still mandate. Label Toolkit generates both symbologies in its free browser-based designer with no software to install.
- Code 128 is the default choice for general shipping and inventory labels: it is denser, shorter, and handles all printable ASCII characters including lowercase letters and special symbols.
- Code 39 is the right choice when a specific standard (such as ANSI MH10.8 for automotive parts or HIBC for healthcare) explicitly requires it, or when your scanner firmware cannot be updated to support Code 128.
- For a 203 dpi Zebra printer with a 10-mil (0.010 inch) X-dimension, a 12-character alphanumeric string prints roughly 1.4 inches wide in Code 128 vs roughly 2.1 inches wide in Code 39.
- Both symbologies need a quiet zone of at least 10X (ten times the X-dimension, typically 0.1 inch minimum) on each side to scan reliably.
What do Code 128 and Code 39 actually encode?
A barcode symbology defines the rules for mapping characters to bar-and-space patterns. The two core factors that determine which symbology fits your use case are the character set (what data you can encode) and the encoding efficiency (how many bars and spaces each character requires).
Code 39 character set
Code 39 (also written as 3 of 9, since exactly 3 of its 9 elements are wide) natively encodes 43 characters: uppercase A through Z, digits 0 through 9, and seven symbols: space, hyphen, period, dollar sign, slash, plus sign, and percent sign. An extended variant called Code 39 Full ASCII maps all 128 ASCII characters by pairing those seven symbols, but scanners must be explicitly set to decode extended mode. The ISO/IEC 16388 standard governs Code 39 and specifies the allowed character set precisely.
Code 128 character set
Code 128 encodes all 128 ASCII characters natively using three internal code sets, A, B, and C, which a compliant encoder switches between automatically. Code set C is particularly efficient: it packs pairs of digits (00 through 99) into a single symbol character, cutting the barcode width roughly in half for pure-numeric data. This is how GS1-128 (formerly EAN-128) fits long application-identifier strings into a scannable label. You can read a deeper treatment of Code 128 structure in our Code 128 barcode format and character set guide.
Side-by-side comparison
| Feature | Code 128 | Code 39 |
|---|---|---|
| Native character set | All 128 ASCII (A-Z, a-z, 0-9, symbols, control chars) | 43 characters (A-Z uppercase, 0-9, 7 symbols) |
| Lowercase letters? | Yes, natively | No (requires extended Code 39 with scanner support) |
| Encoding efficiency | High; ~30% shorter than Code 39 for same data | Low; each character is 9 elements (3 wide) |
| Check digit | Mandatory, calculated automatically by encoder | Optional (Mod 43); some industries require it |
| Start/stop characters | Single start code (A, B, or C) + stop bar | Asterisk (*) wraps the payload; visible in human-readable text |
| Minimum quiet zone | 10X on each side (X = narrow bar width) | 10X on each side |
| Self-checking? | No (relies on mandatory check character) | Yes; each character pattern is inherently self-checking |
| Common use cases | Shipping labels, GS1-128, retail, warehouse, general purpose | Automotive (AIAG), healthcare (HIBC), government, internal tracking |
| Scanner support | Universal; all modern 1D and 2D imagers read it | Universal; even older laser scanners support it |
| ZPL command (Zebra) | ^BC | ^B3 |
How encoding efficiency affects label real estate
Encoding efficiency is the practical difference most label designers notice first. Code 39 represents each character with 5 bars and 4 spaces, 3 of which are wide. Code 128 uses a variable-length pattern that averages roughly 11 modules per character but packs pairs of digits into a single codeword in code set C.
Here is a concrete example at a common 203 dpi Zebra printer setting with an X-dimension of 13 mils (0.013 inch, or approximately 0.33 mm):
- Encoding "ITEM12345678" (12 characters, mixed alpha-numeric) in Code 128 produces a barcode roughly 1.5 inches (38 mm) wide, excluding quiet zones.
- The same string in Code 39 produces roughly 2.3 inches (58 mm) wide.
- Adding two 0.13-inch quiet zones (10X each side) adds 0.26 inch to both. On a 4-inch-wide label this matters a great deal.
For pure-digit data, Code 128C is dramatically more efficient: a 20-digit string occupies about the same width as a 10-character Code 128B barcode because each digit pair compresses to one symbol character. Code 39 has no equivalent compression mode.
Quiet zones: the margin rule both symbologies share
A quiet zone is the blank space immediately to the left and right of a barcode where no ink appears. Scanners use it to detect where the barcode begins and ends. Both Code 128 and Code 39 require a minimum quiet zone of 10X, where X is the width of the narrowest bar (the X-dimension).
At a 10-mil X-dimension, that is 0.10 inch (2.54 mm) per side. Compress the X-dimension to 7.5 mils to save space, and the quiet zone shrinks to 0.075 inch, which is fine in theory but risky in practice when label stock shifts or print registration drifts. Our dedicated article on barcode quiet zones and margin rules covers the measurement math in full detail. Label Toolkit enforces quiet-zone padding automatically when you render either symbology in the designer.
When to choose Code 39
Despite being older and less efficient, Code 39 is still the correct choice in specific situations.
Industry mandates
The Automotive Industry Action Group (AIAG) MMOG/LE standard and many automotive part labels specify Code 39. The Health Industry Business Communications Council (HIBC) label standard also uses Code 39 as its base symbology. If your trading partner's routing guide says Code 39, use Code 39 regardless of efficiency.
Legacy scanner environments
Some fixed-mount laser scanners installed in factories or warehouses a decade or more ago may only decode Code 39. Upgrading scanner firmware or hardware is the right long-term answer, but Code 39 can bridge the gap in the short term.
Simplicity and human-readability
Because the asterisk start/stop character is visible in Code 39's human-readable text (printed below the bars), operators can spot a corrupt label at a glance. The check digit is also optional, which simplifies manual verification workflows in low-volume, low-stakes environments.
