Barcode Formats: UPC, EAN, Code 128 Explained

· 12 min read

Table of Contents

Understanding Barcode Formats

Barcodes have revolutionized how businesses track products, manage inventory, and process transactions. These machine-readable patterns encode information that scanners can instantly decode, eliminating manual data entry and reducing human error.

At their core, barcodes translate alphanumeric data into visual patterns. When a scanner reads these patterns, it converts them back into digital information that computer systems can process. This simple yet powerful technology has become indispensable across retail, healthcare, logistics, manufacturing, and countless other industries.

The choice of barcode format depends on several factors: the amount of data you need to encode, the scanning environment, international compatibility requirements, and industry standards. Understanding these formats helps you make informed decisions that optimize your operations.

Pro tip: Before implementing any barcode system, verify which formats your industry requires. Retail products sold in North America typically need UPC codes, while international distribution requires EAN-13 compliance.

Exploring 1D Barcode Formats

One-dimensional (1D) barcodes represent data through varying widths and spacings of parallel lines. These linear barcodes are read horizontally and remain the most common format in retail and supply chain applications due to their simplicity and widespread scanner compatibility.

The primary advantage of 1D barcodes is their reliability. Even basic scanners can read them accurately, and they work well on curved surfaces or when printed at small sizes. However, they're limited in data capacityβ€”typically encoding between 8 and 25 characters.

UPC-A Barcodes

UPC-A (Universal Product Code) barcodes dominate the North American retail landscape. Developed in the 1970s, this format consists of exactly 12 numerical digits and has become the standard for consumer products sold in the United States and Canada.

The structure of a UPC-A barcode follows a specific pattern:

0 12345 67890 5
β”‚ β””β”€β”€β”€β”¬β”€β”€β”˜ β””β”€β”€β”¬β”€β”˜ β”‚
β”‚     β”‚       β”‚   └─ Check digit
β”‚     β”‚       └───── Item number
β”‚     └─────────── Company prefix
└─────────────── Number system digit

The first digit indicates the number system (typically 0 or 1 for regular products). The next five digits represent the manufacturer's unique GS1 company prefix. The following five digits identify the specific product. The final digit is a check digit calculated using a modulo 10 algorithm to verify scanning accuracy.

To obtain UPC codes for your products, you must purchase a GS1 company prefix from GS1 US. This prefix remains yours permanently, allowing you to create unique codes for each product in your catalog. Our Barcode Generator can help you create properly formatted UPC-A barcodes once you have your company prefix.

Quick tip: Never reuse UPC codes from discontinued products. Each code should permanently identify a specific product to maintain data integrity across retail systems.

EAN-13 Barcodes

EAN-13 (European Article Number) serves as the international counterpart to UPC-A. This format contains 13 digits and is the global standard for retail products, accepted in over 150 countries worldwide.

The EAN-13 structure includes:

8 12345 67890 3
β”‚ β””β”€β”€β”€β”¬β”€β”€β”˜ β””β”€β”€β”¬β”€β”˜ β”‚
β”‚     β”‚       β”‚   └─ Check digit
β”‚     β”‚       └───── Item number
β”‚     └─────────── Company prefix
└─────────────── Country code

The first two or three digits represent the GS1 country code (not necessarily where the product was manufactured, but where the company obtained its prefix). For example, codes beginning with 00-13 indicate United States, 30-37 indicate France, and 400-440 indicate Germany.

If you're selling products internationally, EAN-13 is essential. Many European and Asian retailers won't accept products with only UPC codes. The good news is that UPC codes can be converted to EAN-13 format by adding a leading zero, making them compatible with international systems.

UPC-E Barcodes

UPC-E is a compressed version of UPC-A designed for small packages where space is limited. It encodes the same 12-digit information into just 6 digits by suppressing zeros in the manufacturer and product codes.

This format works best for:

UPC-E barcodes can only be created from UPC-A codes that contain specific patterns of zeros. Not all UPC-A codes are compressible to UPC-E format, so verify compatibility before printing.

EAN-8 Barcodes

EAN-8 provides an even more compact option with just 8 digits. This format is intended for extremely small products where even EAN-13 won't fit, such as cigarette packs, chewing gum, or small cosmetic items.

The structure includes a 2-3 digit country code, 4-5 digit product code, and a check digit. Because of the limited number of available codes, EAN-8 requires special authorization from your local GS1 organization and is only granted when EAN-13 is genuinely impractical.

Deep Dive: Code 128 Barcodes

Code 128 represents a significant advancement in 1D barcode technology. Unlike UPC and EAN formats that encode only numbers, Code 128 can encode the full 128-character ASCII set, including uppercase and lowercase letters, numbers, and special characters.

This versatility makes Code 128 the preferred choice for applications beyond retail point-of-sale, including shipping labels, inventory management, and internal tracking systems.

Code 128 Character Sets

Code 128 uses three character sets (A, B, and C) that can be switched within a single barcode to optimize encoding efficiency:

Character Set Encodes Best For
Code 128A Uppercase letters, numbers, control characters Data with control codes or special formatting
Code 128B Upper and lowercase letters, numbers, symbols Alphanumeric data with mixed case
Code 128C Numeric pairs (00-99) Long numeric sequences (most efficient)

Modern barcode generators automatically select the optimal character set combination to create the most compact barcode possible. For example, a serial number like "SN123456789" would use Code 128B for "SN" then switch to Code 128C for the numeric portion.

GS1-128 (Formerly UCC/EAN-128)

GS1-128 builds on Code 128 by adding Application Identifiers (AIs) that define the meaning of encoded data. This standardized approach enables supply chain partners to share detailed product information beyond simple identification numbers.

Common Application Identifiers include:

A GS1-128 barcode on a pharmaceutical package might encode: (01)10614141234567(17)251231(10)ABC123, indicating the product GTIN, expiration date of December 31, 2025, and batch number ABC123.

This format is mandatory for shipping to major retailers like Walmart, Target, and Amazon, as well as for healthcare products requiring serialization. Use our GS1-128 Generator to create compliant labels with proper Application Identifiers.

Pro tip: When implementing GS1-128, document which Application Identifiers you're using and share this information with trading partners. Consistent AI usage prevents confusion and scanning errors.

Advantages of 2D Barcodes

Two-dimensional (2D) barcodes encode information both horizontally and vertically, creating a matrix pattern rather than parallel lines. This fundamental difference allows 2D barcodes to store significantly more dataβ€”up to several thousand characters compared to the 20-30 character limit of most 1D formats.

Beyond capacity, 2D barcodes offer built-in error correction. If part of the barcode is damaged or obscured, the scanner can still read it accurately. This resilience makes them ideal for harsh environments or long-term applications where print quality may degrade.

QR Codes

QR (Quick Response) codes have become ubiquitous thanks to smartphone camera integration. Originally developed for automotive manufacturing in Japan, they now serve countless applications from marketing to contactless payments.

QR codes can encode:

The error correction capability of QR codes operates at four levels: L (7% recovery), M (15% recovery), Q (25% recovery), and H (30% recovery). Higher error correction creates larger, more complex codes but ensures reliability even when partially damaged.

For marketing applications, QR codes excel at bridging physical and digital experiences. A code on a product package can link to instructional videos, warranty registration, or promotional offers. Generate custom QR codes with our QR Code Generator.

Data Matrix Codes

Data Matrix codes pack maximum information into minimal space, making them perfect for marking small components in electronics, pharmaceuticals, and aerospace industries. These square or rectangular patterns can be as small as 2-3mm per side while remaining scannable.

Key advantages include:

The FDA requires Data Matrix codes for pharmaceutical track-and-trace compliance. Medical device manufacturers use them for unique device identification (UDI). Electronics manufacturers mark circuit boards and components for traceability throughout the production process.

PDF417 Barcodes

PDF417 (Portable Data File) is a stacked linear barcode that looks like multiple 1D barcodes arranged vertically. It can encode up to 1,850 alphanumeric characters or 2,710 numeric digits, making it suitable for applications requiring substantial data storage.

Common uses include:

PDF417 offers adjustable error correction levels and can be read by standard linear scanners when configured appropriately. However, it requires more vertical space than Data Matrix or QR codes, limiting its use on small items.

Selecting the Right Barcode Format

Choosing the optimal barcode format requires analyzing your specific requirements across multiple dimensions. The wrong choice can lead to scanning failures, compliance issues, or operational inefficiencies.

Data Capacity Requirements

Start by determining what information you need to encode. Simple product identification requires only 12-13 digits (UPC/EAN). Serial numbers, batch codes, and expiration dates need alphanumeric capability (Code 128 or GS1-128). Complex data like product specifications or certificates of analysis require 2D formats.

Consider future needs as well. If you might need to add data fields later, choosing a format with growth capacity prevents costly system changes.

Industry Standards and Compliance

Many industries mandate specific barcode formats:

Industry Required Format Reason
Retail (North America) UPC-A Universal retail standard
Retail (International) EAN-13 Global compatibility
Pharmaceuticals Data Matrix, GS1-128 FDA serialization requirements
Healthcare GS1-128, Data Matrix Patient safety and traceability
Logistics/Shipping GS1-128, Code 128 Carrier and retailer requirements
Automotive Code 128, Data Matrix Parts tracking and quality control

Verify requirements with your trading partners, retailers, or regulatory bodies before implementation. Non-compliant barcodes can result in rejected shipments, fines, or inability to sell products.

Scanning Environment Considerations

The physical environment where barcodes will be scanned significantly impacts format selection. Retail point-of-sale systems typically use laser scanners optimized for 1D barcodes. Warehouses might use rugged 2D imagers that handle any format. Mobile applications rely on smartphone cameras that work best with QR codes.

Environmental factors to consider:

Quick tip: Test your chosen barcode format in actual operating conditions before full deployment. Print samples and verify scan rates, read distances, and reliability with your specific equipment.

Print Size and Substrate

Available space on your product or label constrains barcode size. UPC-A requires a minimum of 1.469 inches wide by 1.02 inches tall at 100% magnification. Code 128 can be more compact but needs adequate height for reliable scanning. Data Matrix codes can be as small as 2-3mm square.

The printing surface also matters. Glossy materials can cause glare that interferes with scanning. Textured surfaces may require larger barcodes or 2D formats with error correction. Direct part marking on metal or plastic works best with Data Matrix codes.

Maintaining Barcode Quality

A barcode that can't be scanned reliably is worse than no barcode at all. Poor quality codes cause delays, errors, and frustrated customers. Maintaining high barcode quality requires attention to design, printing, and verification.

Print Quality Standards

The ISO/IEC 15416 standard defines barcode quality grading from A (best) to F (failure). This grading evaluates multiple parameters including edge contrast, modulation, defects, and decodability. Most retail and logistics applications require a minimum grade of C, while some industries demand grade B or A.

Key quality factors include:

Thermal transfer printing generally produces the highest quality barcodes for labels. Direct thermal printing works well for short-term applications but fades over time. Inkjet and laser printing can work but require careful calibration and high-resolution settings.

Quiet Zone Requirements

The quiet zone (blank space surrounding the barcode) is critical for reliable scanning. Scanners need this clear area to detect where the barcode begins and ends. Insufficient quiet zones are one of the most common causes of scanning failures.

Minimum quiet zone requirements:

Never place text, graphics, or other design elements within the quiet zone. Avoid printing barcodes too close to label edges where cutting or folding might encroach on this space.

Color Considerations

Barcode scanners work by detecting contrast between dark and light areas. Black bars on white backgrounds provide optimal contrast, but other color combinations can work if they maintain sufficient contrast.

Safe color combinations:

Avoid these combinations:

When printing on colored packaging, use a white background patch for the barcode to ensure adequate contrast.

Verification and Testing

Professional barcode verifiers measure quality according to ISO standards and provide detailed reports on any deficiencies. These devices cost several hundred to several thousand dollars but are essential for high-volume production or regulated industries.

For smaller operations, thorough testing with your actual scanning equipment provides practical validation. Scan barcodes from various angles, distances, and lighting conditions. Test with multiple scanners if possible, as different models may perform differently.

Implement a verification process that includes:

  1. Visual inspection for obvious defects
  2. Test scanning with production equipment
  3. Periodic verification with calibrated equipment
  4. Documentation of quality metrics and issues
  5. Corrective action procedures for failures

Pro tip: Keep sample barcodes from each production run. If scanning issues arise later, you can compare current output to known good samples to identify when problems began.

Integrating Barcode Technology

Successful barcode implementation extends beyond simply printing codes on products. It requires integrating scanning hardware, software systems, and business processes into a cohesive workflow.

Hardware Selection

Barcode scanners come in numerous form factors, each suited to different applications. Handheld scanners work well for retail checkout and warehouse picking. Fixed-mount scanners automate scanning on conveyor systems. Mobile computers combine scanning with data processing and wireless connectivity.

Scanner technology options include:

Consider your scanning volume, barcode types, environmental conditions, and budget when selecting hardware. Rugged scanners withstand drops and harsh conditions but cost more. Consumer-grade equipment works for light-duty applications.

Software Integration

Barcode data only provides value when integrated with your business systems. Inventory management, point-of-sale, warehouse management, and enterprise resource planning (ERP) systems all need to receive and process scanned data.

Integration approaches include:

Modern cloud-based systems often provide APIs that accept barcode data from multiple sources. This flexibility enables mobile apps, web interfaces, and dedicated scanning devices to all feed the same database.

Database Design

Your database structure must accommodate barcode data and associated product information. At minimum, you need tables for products, locations, transactions, and users. More complex systems track serial numbers, lot codes, expiration dates, and detailed transaction histories.

Key database considerations:

Plan for scalability from the start. A system that works with 100 products may struggle with 10,000. Index key fields, optimize queries, and consider partitioning strategies for large datasets.

Training and Change Management

Technology alone doesn't guarantee success. Staff must understand how to use barcode systems effectively and why accurate scanning matters. Develop training programs that cover equipment operation, troubleshooting common issues, and proper procedures.

Address resistance to change by involving users in the implementation process. Gather feedback on workflow design and

We use cookies for analytics. By continuing, you agree to our Privacy Policy.