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

Frequently Asked Questions

Can a barcode contain letters and numbers?
Yes. Most 1D barcode formats used outside retail, including Code 128 and Code 39, are built to hold letters, numbers, and a set of symbols in the same string. The retail-focused UPC and EAN formats are the main exception, since they are defined as numeric-only by design.
Can a UPC have letters?
No. A UPC-A barcode is a fixed 12-digit numeric code, and EAN-13 is a fixed 13-digit numeric code. Neither symbology has a mode for encoding letters. A product that needs a letter-based identifier has to use a different barcode type, such as Code 128, alongside or instead of its UPC.
Which barcode types support letters?
Code 39, Code 128, Code 93, and GS1-128 are the common linear barcodes that support letters. Most 2D formats, including QR codes, Data Matrix, Aztec Code, and PDF417, also support letters, and generally hold far more mixed text than any linear barcode.
How many characters can a barcode hold?
It depends on the symbology and the print size. Code 39 and Code 128 typically stay practical somewhere under a few dozen characters on a standard label, while 2D formats like QR codes and Data Matrix can hold hundreds of alphanumeric characters in the same physical space.
Why do some barcodes only allow numbers?
UPC and EAN were designed decades ago around a fixed-length numeric product number so that every retail scanner and point-of-sale system could decode them the same way. Locking the format to digits only keeps that decoding simple and consistent across every store and manufacturer.