
Barcode TypesBarcode Types
Can a Barcode Show an Expiration Date or Lot Number?
Learn when a barcode can carry an expiration date or lot number, and how to check the package and the source of a lookup result.
Learn what Code 128 encodes, how its character sets work, and what to check before using a barcode on labels or in a receiving system.

Code 128 is a linear barcode symbology that can encode numbers, uppercase and lowercase letters, punctuation, and control characters. It can be useful for internal inventory or asset identifiers when the receiving system supports it. To decide whether it fits your label, check the exact characters you need, the available space, and the requirements of the scanner and receiving application before printing a batch.[1]
A Code 128 symbol is a row of bars and spaces of varying widths. It includes a start character, encoded data, a required symbol check character, and a stop pattern, with clear space around the symbol. The readable text printed alongside a barcode can help a person identify the value, but you should compare it with the actual decoded result.[1][2]
Appearance alone is not a reliable way to distinguish Code 128 from every other linear barcode. Use a reader that reports the symbology or check the label’s specification. A successful read does not establish who assigned the data or whether a trading partner accepts the label.
Code 128 uses three code sets. An encoder can select or switch sets to represent the input:[1]
| Code set | Useful capability |
|---|---|
| A | Uppercase characters, digits, punctuation and control characters. |
| B | Uppercase and lowercase characters, digits and punctuation. |
| C | Pairs of digits from 00 to 99, useful for compact numeric sequences. |
For instance, Ab-00123 is a plausible internal identifier containing a capital letter, a lowercase letter, a hyphen and leading zeros. A Code 128 encoder that supports the required characters can represent it. Preserve the value exactly, and check that the receiving application gets Ab-00123, not a changed case or shortened number. This is an illustrative string; it is not a registered product identifier.
“128” refers to the basic ASCII character repertoire, not a universal limit of 128 characters per symbol. Practical length depends on the encoded data, encoder, label size, printer and scanner. Code set C represents two digits in one symbol character, but the final dimensions still depend on the actual encoding and the intended X-dimension.[1][2]
GS1-128 is a subset of Code 128 used with GS1 data rules.[3] It uses application identifiers and specified syntax to identify fields such as a trade item or batch. Choosing a generic Code 128 setting does not automatically make the data or label GS1-128 compliant. If a trading partner requires GS1-128, obtain its current data and label requirements and use an encoder that supports the required GS1 syntax.
Similarly, a Code 128 image is not a newly issued GTIN, a carrier-issued tracking label, or proof of retail acceptance. Get the correct identifier and permissions from the appropriate issuer before encoding it.
A successful scan on one device is a practical check under those conditions, not a formal quality grade or a guarantee that every label in a run will work. Where a customer requires a grade, use the specified verification method and acceptance criteria.[4]
[1] Libre Barcode Project. Code 128. https://graphicore.github.io/librebarcode/documentation/code128.html
[2] GS1. GS1 General Specifications, section 5.4, GS1-128 symbology. https://ref.gs1.org/standards/genspecs/24.0.0/
[3] GS1. GS1 Glossary: Code 128. https://ref.gs1.org/glossary/code_128
[4] GS1. How can I measure the quality of my printed barcodes? https://support.gs1.org/support/solutions/articles/43000734152-how-can-i-measure-the-quality-of-my-printed-barcodes-