Barcode Types

Code 39 vs. Code 128: Which Barcode Should You Use?

Compare character support, label space and scanner settings for Code 39 and Code 128, then check the result against your receiving system.

Share
Table of contents

Choose Code 39 when your receiving system specifies it or your existing workflow uses it successfully and its basic character set fits your data. Consider Code 128 when the receiving system accepts it and you need lowercase characters or a more compact symbol, especially for longer numeric data. Before changing formats, test the exact data, printed label, scanner settings and receiving application together. A barcode that scans is useful only if the receiving system gets the intended value.

Compare the requirements first

Question Code 39 Code 128
Basic data Uppercase A–Z, digits 0–9, space and seven punctuation characters. Extended Code 39 can represent additional ASCII characters using pairs, if the encoder and reader handle them correctly.[1] Uses code sets A, B and C. Across those sets it can represent the 128 basic ASCII characters; set B includes lowercase, and set C encodes pairs of digits.[2]
Space Often longer for the same data. Its actual width depends on the data and print settings. Often more compact; numeric pairs in set C can reduce length. Actual width depends on code-set choices, module size and the label.[2]
Check character An optional Mod 43 check character may be required by an application; the reader must be configured accordingly.[1][3] Uses a mandatory symbol check character. It helps detect errors; it does not verify that the original data or the chosen item is correct.[2]
Existing workflow Can be the right choice when the recipient requires Code 39 or uses a validated Code 39 process. Use only when the recipient’s reader and application accept the required Code 128 data and output.

The 43 in Code 39’s basic set is the number of supported data characters, not a maximum of 43 characters per barcode. Both formats have variable length, but the physical label, scanner, printer and receiving application can impose practical limits.[1][2]

Start with the data and the recipient

First ask the receiving organization or system owner which symbology and data format it accepts. A customer specification takes precedence over a general comparison. If a shipping or retail workflow supplies its own label, use that workflow’s requirements rather than replacing the symbol based on this article.

Then inspect the exact value:

  • AB-1234 uses uppercase letters, digits and a hyphen, so it fits basic Code 39 and can also be encoded in Code 128. If both are accepted, compare actual labels and keep the one that meets the space and scanning requirements.
  • ab-1234 contains lowercase letters. Basic Code 39 does not encode them directly. Code 128 can represent them; extended Code 39 is another possibility only if the entire encoder-to-reader workflow supports the paired-character interpretation.[1][2]
  • 001234567890 is numeric. Preserve both leading zeros. Code 128 set C can encode pairs of digits efficiently, but the final label must still fit with its required clear margins and be readable by the target scanner.[2]

These are illustrative data strings, not tested printed labels. Do not change lowercase to uppercase or remove zeros merely to fit a symbology unless the data owner confirms that doing so preserves the intended identifier.

Why size comparisons need the same conditions

Code 128 is often a good candidate when space is limited, particularly with an even-length numeric string. Its code set C represents two digits in one symbol character.[2] But a comparison is meaningful only when both samples use the same data and comparable module size, height, margins, printing process and surface. A Code 128 encoder may choose different code sets for the same data, changing the resulting width.[2]

Do not shrink a label until it fits and assume it will work. Make test labels at the intended physical size, including the required quiet zones, and use the actual printer, material and scanner. If one fails, inspect print quality, scanner capability and settings as well as the symbology. A successful read on one phone or scanner does not establish a formal print-quality grade or acceptance by every trading partner.[4]

Check digits, extended characters and the receiving system

A check character is an error-detection mechanism, not a guarantee that the data belongs to the right item. Code 39 can use Mod 43; Code 128 includes a symbol check character.[1][2] Agree with the receiver on whether a Code 39 check character is required and whether the scanner checks or transmits it. For example, one Zebra scanner configuration can check and remove a Code 39 check character before transmitting data; exact options depend on the model and setup.[3]

Extended Code 39 uses pairs of basic characters for additional ASCII values. A scanner configured for Full ASCII conversion can interpret such pairs differently from a basic Code 39 reader.[1][3] If the application expects the literal characters instead, a setting mismatch can change the received result. Compare the exact output in the destination field, including case, spaces, leading zeros and any prefixes or suffixes.

Code 128 is not automatically GS1-128. GS1 describes GS1-128 as a subset of Code 128; it adds rules for structured GS1 data. If a partner requires GS1-128, obtain its data, formatting and label requirements rather than selecting ordinary Code 128 and assuming it is equivalent.[5]

A practical acceptance check

  1. Write down the exact source value and the recipient’s required symbology, data format and any check-character rules.
  2. Generate a sample using a compatible encoder. For an approved comparison, generate both formats from the same source value without changing it.
  3. Print each candidate at its intended size on the intended material, preserving its quiet zones.
  4. Scan with the target device and settings into the actual receiving field. Compare the full result character by character with the source. Test representative values, including the longest and any leading zeros, lowercase or punctuation your workflow uses.
  5. If a read fails or the value changes, check the symbol type, print quality, enabled symbologies, Full ASCII conversion and check-character handling. Correct the cause and retest. Where a formal grade is required, arrange verification to the applicable specification; a simple scan is not that grade.[4]

Keep the sample and record the printer, settings, material, scanner and software version. Ask the receiving partner to confirm acceptance before replacing an existing label format.

References

[1] Zebra Technologies. ^B3: Code 39 Barcode; Mod 43 Check Digit. https://docs.zebra.com/us/en/printers/software/zpl-pg/c-zpl-zpl-commands/r-zpl-b3.html ; https://docs.zebra.com/us/en/printers/software/zpl-pg/c-zpl-mod10-mod-10-mod-43-checkdigits/t-zpl-mod10-mod-43-check-digit.html

[2] ISO. ISO/IEC 22742 draft, section 3.1 Code 128. https://www.iso.org/obp/ui?_escaped_fragment_=iso%3Astd%3Aiso%3A22742%3Adis%3Aed-3%3Av1%3Aen

[3] Zebra Technologies. AIM Code Identifiers. https://docs.zebra.com/us/en/scanners/general/sx20-series/sp20-prg/c-param-desc-programming-reference/r-param-desc-aim-code-identifiers.html

[4] GS1. GS1 General Specifications, Release 23.0, section 5.12.5.1. https://ref.gs1.org/standards/genspecs/23.0.0/

[5] GS1. GS1 Glossary: Code 128. https://ref.gs1.org/glossary/code_128