Different Types of Barcodes Explained: UPC, EAN, Code 128 and More
Standing in the barcode aisle of modern commerceâif such a place existedâwould be like visiting a babel of visual languages, each speaking its own dialect of lines and spaces. Over 300 different barcode symbologies have been developed since the 1970s, each optimized for specific industries, data types, or scanning environments. From the familiar UPC on your cereal box to the complex PDF417 on your driver's license, each barcode type represents a solution to unique challenges in data encoding, space constraints, and reading conditions. Understanding these different types of barcodes isn't just academic curiosityâit's essential for anyone implementing scanning systems, designing packaging, or working in supply chain management. The choice of barcode can mean the difference between seamless operations and costly failures, between fitting required data in available space and redesigning entire packaging systems.
The Universal Product Code (UPC) Family
The UPC-A barcode, the 12-digit standard that revolutionized retail, remains the most recognizable barcode format in North America. Every UPC-A code follows the same rigid structure: a single-digit number system character (0 for regular products, 2 for variable-weight items, 3 for pharmaceuticals), a 5-digit manufacturer code assigned by GS1, a 5-digit product code assigned by the manufacturer, and a check digit calculated mathematically from the other 11 digits. This structure enables over 100 billion unique product combinations while maintaining a compact size of approximately 1.5 inches wide by 1 inch tall at standard magnification.
The genius of UPC-A lies in its encoding efficiency and error resistance. Each digit is represented by seven modules using a binary pattern, but the patterns differ depending on positionâleft-side digits use different patterns than right-side digits, creating built-in orientation detection. The guard bars (start, middle, and end patterns) provide synchronization points that help scanners maintain timing even when codes are scanned at varying speeds. The variable width bars (from 1 to 4 modules wide) create the distinctive visual rhythm while maintaining constant data density.
UPC-E emerged as a compressed version for small packages where space is at premium. This 8-digit format (appearing as 6 digits visually) uses a clever suppression algorithm to encode certain UPC-A codes in roughly half the space. The system works by eliminating zeros from the manufacturer code and product code according to specific patterns. For example, a UPC-A code like 0-12345-00007-8 can be compressed to the UPC-E code 0-123457-8. The scanner expands it back to full UPC-A format using predetermined rules. This compression only works for about 7% of possible UPC-A codes, but manufacturers can request compatible numbers when registering products.
The supplemental barcodes (EAN-2 and EAN-5) that sometimes appear alongside UPC codes serve specialized purposes. On magazines and newspapers, a 2-digit supplement indicates issue number, while books use 5-digit supplements for pricing in specific currencies. These supplements use a unique encoding scheme with variable-width guard patterns determined by a checksum calculation, making them extremely resistant to partial scanning. Publishers can change prices or issue numbers without regenerating the main barcode, simply by updating the supplement.
Variable-weight UPC codes, identified by a "2" prefix, solve the challenge of items sold by weight like deli meats or produce. The manufacturer code is shortened to 5 digits (actually 4 visible digits after the "2"), leaving 5 digits for price or weight information. Individual retailers can assign these codes internally for products packaged in-store. The encoding of price versus weight varies by retailer systemâsome encode the price directly, others encode weight and calculate price from a database lookup. This flexibility allows stores to handle everything from bulk coffee to custom-cut steaks using standard scanning equipment.
The International EAN/IAN System
The EAN-13 (European Article Number, now International Article Number) extends UPC-A with an additional digit, creating a truly global system. The extra digit allows for country codes, though these don't necessarily indicate where a product was manufacturedâthey identify where the manufacturer's barcode prefix was assigned. For example, codes beginning with 00-13 are assigned in the United States and Canada, 45-49 in Japan, 690-695 in China, and 50 in the United Kingdom. This country code system enables over 10 trillion unique product codes globally while maintaining backward compatibility with UPC-A (which is essentially EAN-13 with a leading zero).
EAN-8 serves as the international equivalent of UPC-E, providing a compact 8-digit code for small packages. Unlike UPC-E's compression algorithm, EAN-8 uses a direct encoding with 2-3 digits for country code, 4-5 digits for product identification, and a check digit. The allocation of EAN-8 codes is strictly controlled due to their limited number spaceâonly about 100,000 codes are available per country. Small producers often struggle to obtain EAN-8 codes, leading to creative packaging solutions to accommodate full-size EAN-13 codes on tiny products.
The ISBN (International Standard Book Number) and ISSN (International Standard Serial Number) systems integrate seamlessly with EAN-13 through a prefix system. Books use the prefixes 978 or 979, allowing the 10-digit ISBN to fit within the EAN-13 structure. When bookstores scan an ISBN barcode, their systems recognize the prefix and can access book-specific databases for title, author, and publication information. This integration enabled bookstores to adopt standard retail scanning equipment rather than requiring specialized systems, dramatically reducing implementation costs.
Restricted distribution codes within the EAN system serve internal use within companies or specific geographic regions. Codes beginning with 20-29 are reserved for in-store use, allowing retailers to create barcodes for products without manufacturer codes. The 977 prefix identifies periodicals with ISSN numbers, while 978 and 979 are reserved for books. The 981-984 range handles common currency coupons, enabling standardized coupon processing across different retailers. These special prefixes demonstrate how the EAN system evolved to accommodate diverse needs while maintaining universal compatibility.
The GTIN (Global Trade Item Number) framework now encompasses all these formatsâUPC-A, UPC-E, EAN-8, and EAN-13âunder a single conceptual system. A 14-digit GTIN can represent any of these formats by adding leading zeros, simplifying database management and international trade. This harmonization means a single database field can store any retail barcode format, with software handling the conversion to appropriate display formats. The GTIN system also extends to shipping containers (GTIN-14 with packaging indicators) and trade items, creating a hierarchical identification system from individual products to pallets.
Industrial and Logistics Codes (Code 39, Code 128, Code 93)
Code 39, developed in 1974 by Intermec, became the first alphanumeric barcode symbology to gain widespread adoption. Its name derives from the original character set of 39 characters (now expanded to 43) and the fact that each character uses 9 elementsâ5 bars and 4 spacesâwith 3 wide and 6 narrow. The simplicity of Code 39 makes it extremely reliable and easy to print, even with low-resolution equipment. Each character is self-contained with its own start and stop elements, meaning partial reads can still yield usable data. This robustness made Code 39 the standard for the U.S. Department of Defense, automotive industry, and healthcare sectors.
The ability to encode letters, numbers, and seven special characters (- . $ / + % and space) makes Code 39 versatile for various identification needs. Part numbers, serial numbers, and inventory codes that mix letters and numbers work seamlessly. The self-checking nature of the codeâeach character has a unique patternâmeans substitution errors are virtually impossible. However, Code 39's major limitation is density; encoding "HELLO" requires about 2 inches of barcode width at minimum size. Extended Code 39 can encode all 128 ASCII characters using two-character combinations, but this doubles the already substantial length.
Code 128, introduced in 1981, revolutionized high-density barcode applications by encoding the full ASCII character set in minimal space. The symbology uses three different encoding subsets that can be mixed within a single barcode: Subset A for uppercase letters and control characters, Subset B for upper and lowercase letters, and Subset C for numeric pairs encoded as single characters. This dynamic switching allows Code 128 to achieve densities 30-40% better than Code 39. A product serial number like "ABC-123456" might use Subset B for the letters, then switch to Subset C for the numbers, optimizing space usage.
The sophistication of Code 128 extends to its error detection capabilities. Every Code 128 barcode includes a modulo 103 check character calculated from the weighted sum of all data characters. The start character identifies which subset begins the code, and special shift characters allow temporary or permanent subset changes. Function characters enable advanced features like linking multiple barcodes or encoding special meanings recognized by application software. GS1-128 (formerly UCC/EAN-128) uses these function characters to create standardized formats for shipping labels, encoding multiple data elements like batch numbers, expiration dates, and serial numbers in a single barcode.
Code 93 represents an evolutionary improvement over Code 39, maintaining alphanumeric capability while achieving higher density. Developed by Intermec in 1982, Code 93 uses the same character set as Code 39 but encodes each character with only 6 elements instead of 9. This 33% reduction in width comes with the trade-off of requiring two check characters for error detection. The military initially adopted Code 93 for marking electronic components where space was limited but data integrity was critical. Today, it's commonly used in airline baggage handling, where tags must fit specific dimensions while encoding routing information.
Specialized Retail and Pharmaceutical Codes
The Pharmacode (also called Pharmaceutical Binary Code) serves a unique niche in pharmaceutical packaging production lines. Unlike other barcodes that encode specific data, Pharmacode represents a simple integer from 3 to 131,070 using a binary system of narrow and wide bars. This integer links to a database containing product information, batch numbers, and packaging specifications. The brilliance of Pharmacode lies in its ability to be read even when print quality is poor or the code is partially obscuredâcritical for high-speed pharmaceutical production where stopping the line costs thousands of dollars per minute.
Pharmacode's unidirectional natureâit can be printed and read in either directionâprovides additional quality control. If medication packaging is fed backwards into a machine, the reversed Pharmacode yields a different number, immediately flagging the error. The minimum height requirement of just 8mm allows placement in extremely confined spaces on blister packs or small vials. Some pharmaceutical companies print Pharmacode in UV-invisible ink as a security feature, readable only by specialized scanners to verify authenticity.
The HIBCC (Health Industry Business Communications Council) codesâboth linear (HIBC LIC) and 2D (HIBC DataMatrix)âaddress healthcare's unique requirements for tracking medical devices, surgical instruments, and pharmaceuticals. These codes can encode lot numbers, expiration dates, and serial numbers using a standardized format recognized globally. The HIBC system uses a Licensed Identification Code (LIC) that identifies the labeler, plus product catalog numbers and unit-of-measure indicators. This standardization enables a surgical instrument manufactured in Germany, sterilized in India, and used in an American hospital to be tracked throughout its lifecycle.
DataBar (formerly RSS or Reduced Space Symbology) represents GS1's solution for small items that couldn't accommodate traditional UPC codes. DataBar can encode GTIN-14 identifiers in a symbol 50% smaller than UPC-A, finally allowing individual produce items to carry barcodes. The symbology includes multiple variants: DataBar Omnidirectional for retail point-of-sale, DataBar Stacked for extremely small items, DataBar Expanded for additional data like weight or expiration dates, and DataBar Limited for items not scanned at retail checkout. The 2014 sunset of restrictions on DataBar use in retail opened new possibilities for inventory tracking and waste reduction.
The National Drug Code (NDC) barcode system mandated by the FDA uses various linear symbologies to encode drug identifiers, lot numbers, and expiration dates. The flexibility to use Code 128, Code 39, or Interleaved 2 of 5 allows manufacturers to choose based on package size and printing capabilities. The FDA's barcode rule, implemented in 2004, requires linear barcodes on most prescription drugs, over-the-counter drugs, and biological products. Studies show this requirement has prevented hundreds of thousands of medication errors, with some hospitals reporting 80% reductions in medication administration errors after implementing bedside barcode scanning.
Two-Dimensional and Stacked Symbologies
PDF417, developed by Symbol Technologies in 1991, pioneered the concept of stacked linear barcodes. Each PDF417 symbol consists of 3 to 90 rows of linear barcode patterns, creating a two-dimensional structure that can encode up to 1,850 text characters or 2,710 digits. The "417" refers to the module structureâeach codeword uses 4 bars and 4 spaces in a pattern 17 modules wide. This format bridges the gap between traditional linear barcodes and true matrix codes, readable by both specialized 2D scanners and modified linear scanners that can capture multiple scan lines.
The error correction capabilities of PDF417 range from Level 0 (detecting errors only) to Level 8 (recovering from up to 510 incorrect or missing codewords). This scalable redundancy allows users to balance data capacity against damage resistance. Driver's licenses in the United States and Canada use PDF417 to encode name, address, date of birth, license number, and restrictionsâinformation that would require dozens of linear barcodes. The AAMVA (American Association of Motor Vehicle Administrators) standard ensures interstate compatibility while allowing states to include additional jurisdiction-specific data.
MicroPDF417 shrinks the concept for applications requiring less data but minimal space. Limited to 250 alphanumeric characters or 366 numeric digits, MicroPDF417 uses the same encoding scheme but with fixed column counts and reduced overhead. Medical device manufacturers use MicroPDF417 on surgical instruments where full PDF417 wouldn't fit. The symbology excels at encoding multiple data elementsâserial number, lot code, expiration dateâin a space comparable to a linear barcode but with built-in data structuring and error correction.
Codablock F represents another approach to stacked symbologies, essentially placing multiple Code 128 barcodes atop each other with linking information. Each row can encode different data types, and rows can be read in any orderâthe symbol includes row indicators that allow reconstruction of the complete message. This flexibility makes Codablock popular in blood banking, where different rows might encode donor ID, blood type, collection date, and expiration date. The ability to read partial symbols means critical information remains accessible even if labels are damaged.
The Composite Symbology system combines linear barcodes with 2D components, creating hierarchical data structures. A UPC barcode might have a MicroPDF417 component encoding batch number and expiration date, readable by advanced scanners while maintaining compatibility with basic retail scanners that read only the linear component. This approach allows gradual technology migrationâretailers can scan basic product identification immediately while preparing systems to utilize extended data. Fresh food producers particularly benefit, encoding harvest dates and origin information that enhances traceability without disrupting existing retail operations.
Frequently Asked Questions About Barcode Types
The most common question about barcode selection is simply: "Which type should I use?" The answer depends on multiple factors that must be carefully balanced. For retail products sold in North America, UPC-A remains mandatory for major retailers. International products require EAN-13. If you're encoding only numbers and have space constraints, consider UPC-E or EAN-8 if you can obtain codes. For internal inventory with alphanumeric codes, Code 128 offers the best density, while Code 39 provides maximum compatibility with older equipment. Healthcare applications should use HIBC standards, while shipping labels typically require GS1-128. When multiple data elements need encoding, evaluate 2D options like PDF417 or DataMatrix.
Space constraints generate numerous questions about minimum barcode sizes. Each symbology has different density characteristics and minimum size requirements. UPC-A requires approximately 1.469 inches width at nominal size, though it can be scaled from 80% to 200%. Code 128 encoding "ABC123" needs about 1.5 inches at minimum resolution. Code 39 for the same data requires 2.8 inches. PDF417 can encode this in a square inch but requires 2D scanning capability. The key insight: switching symbologies often provides more space savings than trying to shrink a particular barcode type below recommended minimums.
Compatibility concerns arise when organizations must support multiple barcode types. Modern 2D imaging scanners can read virtually any barcode symbology, but at higher cost than basic laser scanners. If you're standardizing on one symbology internally but must accommodate supplier or customer requirements for others, consider a translation layer in your software rather than physically re-labeling products. Many warehouse management systems can map between different barcode formats, reading a supplier's Code 39 part number and printing your internal Code 128 labels.
Questions about encoding special characters reveal the limitations of different symbologies. Code 39 handles only uppercase letters, numbers, and seven special characters. Need lowercase? You'll need Code 128 or Code 93. Want to encode tabs, carriage returns, or other control characters? Code 128 Subset A is your only linear option. For international characters beyond basic ASCII, you'll need 2D symbologies with byte mode encoding. Understanding character set limitations early in system design prevents costly surprises when someone needs to encode an email address (@ symbol) in Code 39 (not possible without Extended Code 39).
The durability requirements of different applications often determine symbology choice. Metal asset tags exposed to weather need symbologies with high redundancyâCode 39 with its self-checking characters or PDF417 with maximum error correction. Chemical drums require barcodes that remain readable after partial dissolutionâDataMatrix with its distributed data pattern excels here. Curved surfaces favor symbologies readable at anglesâomnidirectional codes like DataBar or 2D codes work better than traditional linear barcodes. The environment should drive the symbology choice, not vice versa.
Migration challenges when changing barcode types generate complex questions. Moving from Code 39 to Code 128 might seem simpleâboth are linear, both encode alphanumeric data. But Code 128's check character algorithm differs, its quiet zones are smaller, and its scanner configuration requirements vary. Successful migrations require parallel running (supporting both old and new formats temporarily), comprehensive testing with all scanner models in use, staff retraining on visual differences, and careful coordination with trading partners. The technical change might take days; the organizational change takes months.