Can Barcodes Have Letters? Alphanumeric Barcodes Explained
Most barcodes can hold letters, not just digits. See which barcode types support alphanumeric data, why UPC and EAN stay numeric, and how length limits work.
Barcodes are often pictured as strings of digits, the kind printed under the bars on a cereal box, but that is only one corner of what barcodes can actually encode. Whether a barcode can hold letters depends entirely on which symbology produced it, and the answer ranges from "not at all" for retail formats to "nearly anything" for the formats used in logistics, healthcare, and manufacturing.
Can a Barcode Contain Letters and Numbers?
Yes, most barcode formats outside of retail product codes are designed to mix letters and numbers freely in the same symbol. Code 128 and Code 39 are the two most common examples, and both were built from the start to carry alphanumeric data rather than digits alone.
The confusion usually comes from UPC and EAN, the barcodes most people see every day at a grocery store. Those two formats are numeric-only, and because they are so visible, people assume all barcodes work the same way. In practice, UPC and EAN are a narrow special case built for one job: identifying a retail product with a fixed-length number. Every other major symbology, from the industrial Code 39 to the dense 2D Data Matrix, was designed with letters, punctuation, or full ASCII text in mind.
Which Barcode Types Support Letters?
Code 39, Code 128, Code 93, and GS1-128 are the linear barcodes built to carry letters, and nearly every 2D barcode format supports letters as well, usually with far more room than a linear barcode of the same physical size. Which one fits a given job depends on how much text needs to fit and whether an industry standard already dictates the format.
Code 39 encodes 43 characters: the uppercase letters A through Z, the digits 0 through 9, and seven symbols such as a space, hyphen, and period, as defined in its ISO/IEC 16388 specification. It does not include lowercase letters natively, though an extended variant can represent them by pairing two standard characters together. Code 39 remains common in automotive, defense, and healthcare labeling because those industries standardized on it decades ago.
Code 128, defined in ISO/IEC 15417, goes further and encodes the complete 128-character ASCII set, including lowercase letters, punctuation, and control characters, by switching between three internal code sets as needed. This is also the symbology underneath GS1-128, the format most shipping carriers and supply chain systems use to pack structured data like lot numbers and dates into a single label. Code 93 offers similar alphanumeric coverage to Code 39 in a denser symbol and is used in similar industrial contexts.
Two-dimensional formats push this much further. A QR code, a Data Matrix symbol, Aztec Code, and PDF417 can all mix letters, numbers, and symbols, and because they store data in a grid rather than a line, they fit far more alphanumeric text into the same label area than any linear barcode can.
Can a UPC Have Letters?
No, a UPC can't contain letters under any circumstance, because UPC-A is defined as a fixed 12-digit numeric code with no character set beyond 0 through 9. The closely related EAN-13 is the same story at 13 digits, and EAN-8 at 8 digits, according to the published length specifications these retail symbologies are built to.
This is a deliberate design constraint, not a technical limitation of barcode printing in general. UPC and EAN exist to carry a GTIN, a globally unique numeric product identifier, and every retail scanner and point-of-sale system in the world is built around decoding that fixed-length numeric structure. Letting the format drift into letters would break that universal compatibility, so GS1, the organization that administers these standards, keeps the character set locked to digits only.
Grocery clerks and self-checkout kiosks aren't reading the number itself, just the pattern of bars that encodes it, but that pattern only works because every scanner on the planet agrees in advance on exactly what a UPC digit looks like. Add letters to the mix and that agreement falls apart.
If a business needs to encode a letter-based identifier alongside a product, the usual approach is to put the numeric GTIN in the UPC or EAN-13 barcode on the package and encode any letter-based data, such as a batch code, lot number, or internal SKU, in a separate Code 128 or 2D barcode printed near it. This is exactly how many pharmaceutical and food packages work today, carrying both a numeric retail barcode and a second alphanumeric barcode for traceability data.
How Many Characters Can a Barcode Hold?
The character limit depends heavily on the symbology, the physical label size, and the scanner's resolution, so there is no single answer, but the practical range runs from a few dozen characters on a linear barcode to hundreds on a 2D barcode of similar size. Numeric-only data also packs tighter than mixed letters and numbers in most formats.
For Code 128, sources disagree on a hard technical ceiling, with some vendor documentation describing no fixed maximum and others citing a practical limit closer to 30 alphanumeric characters or 60 digits before the symbol becomes too wide to print or scan reliably at typical label sizes. The gap reflects the difference between what the specification technically allows and what actually scans well on a standard label and scanner, rather than a disagreement about the symbology itself.
Numeric data also encodes more densely than letters in several formats. Code 128's numeric mode packs two digits into each symbol character, which is part of why barcodes built purely from digits can be noticeably shorter than ones carrying the same number of mixed letters and numbers.
2D codes change this equation substantially. A QR code or Data Matrix symbol scales up in a grid rather than a line, so adding more characters makes the symbol denser or slightly larger rather than much longer, which is why 2D formats are the usual choice whenever a barcode needs to hold a long alphanumeric string, such as a URL or a serialized product code with multiple embedded fields.
How Do You Choose Between Numeric and Alphanumeric Barcodes?
Use UPC or EAN only when the application is retail point-of-sale scanning of a product's GTIN, since that is the one case where the numeric-only constraint is actually required by the ecosystem. For almost everything else, from internal inventory tags to shipping labels to serialized traceability codes, an alphanumeric format gives more flexibility without giving up anything in reliability.
Within the alphanumeric options, Code 128 generally wins over Code 39 for new systems because it is denser and covers the full ASCII character set, while Code 39 stays the right pick where an existing industry standard already specifies it. When the data to encode is long, structured, or needs to include a URL, a 2D format like QR code or Data Matrix is usually the better fit, since it can carry far more alphanumeric content in the same label space than any linear barcode. The guide to choosing a barcode type covers this decision in more depth across all of the common symbologies.
Sources
- Code 39 - Wikipedia - character set, ISO/IEC 16388 specification, and extended ASCII variant.
- Code 128 Specification - Barcodes Inc. - ISO/IEC 15417 character set and code subset structure.
- Table of Symbologies - Seagull Scientific - fixed digit lengths for UPC-A, EAN-13, and EAN-8.
- Code 128 and EAN 128 - Accusoft - discussion of Code 128 length behavior and density.