Back to Knowledge Base
Business Tools• 6 min read• November 16, 2026

Understanding Barcode Types: Code 128, QR Code, EAN, and UPC Explained

Written by Saurabh Kumar Sharma

# Understanding Barcode Types: Code 128, QR Code, EAN, and UPC Explained

Optical machine-readable codes connect physical merchandise to digital inventory systems. From supermarket checkout counters to international cargo hubs, barcodes prevent manual entry errors, accelerate transactions, and automate stock records.

However, barcodes are not universal. Each barcode type—formally known as a symbology—follows specific mathematical rules, character sets, and optical tolerances. Using the wrong format can cause rejected freight shipments, checkout delays, or unreadable asset tags.

Whether producing linear labels with the Barcode Generator or deploying mobile tags with the QR Code Generator, understanding each format ensures reliable, compliant operations.


1. 1D Linear Barcodes vs. 2D Matrix Codes

Barcode technologies fall into two primary mechanical architectures:

1D Linear Symbologies One-dimensional (1D) barcodes represent data horizontally using alternating black bars and white spaces. - **Scanning**: Laser scanners or linear CCD sensors read contrast across a single horizontal axis. - **Capacity**: Typically 10 to 80 characters. More data widens the label footprint. - **Applications**: Retail checkout, carton routing, and inventory tracking.

2D Matrix Symbologies Two-dimensional (2D) codes encode data across both horizontal and vertical axes using modular grids. - **Scanning**: Camera imagers capture the pattern and decode it using digital image processing. - **Capacity**: Holds thousands of alphanumeric characters in a compact square. - **Error Correction**: Uses Reed-Solomon algorithms to decode damaged or obscured labels.


2. Core Barcode Symbologies Explained

Code 128: Logistics and Supply Chain Workhorse Introduced in 1981, **Code 128** is a high-density linear symbology encoding the full 128 ASCII character set. - **Subsets**: Employs three subsets (A, B, C). Subset C encodes numeric pairs per symbol, doubling density for numeric tracking IDs. - **Integrity**: Uses a Modulo 103 checksum to prevent misreads. - **Standards**: Forms the basis of **GS1-128**, standardizing shipping cartons and freight tracking.

UPC-A: North American Retail Benchmark The **Universal Product Code (UPC-A)** has anchored North American retail checkout since 1974. - **Structure**: Encodes 12 numeric digits: a 1-digit system character, a 5-digit manufacturer prefix, a 5-digit item code, and a Modulo 10 check digit. - **Governance**: Managed by GS1 US to prevent overlapping manufacturer codes. - **Applications**: Point-of-sale consumer packaging throughout the US and Canada.

EAN-13: Global Retail Standard The **International Article Number (EAN-13)** is the international retail standard outside North America. - **Structure**: Encodes 13 numeric digits: a 2-to-3-digit country prefix, a manufacturer prefix, an item number, and a Modulo 10 check digit. - **Compatibility**: EAN-13 scanners read UPC-A codes directly by treating them as 13-digit numbers with a leading zero. - **Applications**: Worldwide consumer goods packaging and international export retail.

Code 39: Industrial and Military Pioneer Developed in 1974, **Code 39** was the earliest alphanumeric symbology adopted across enterprise and military logistics. - **Character Set**: Supports 43 characters: uppercase letters (A–Z), digits (0–9), and seven symbols (space, `-`, `.`, `$`, `/`, `+`, `%`). - **Structure**: Each character uses nine elements (five bars, four spaces), three of which are wide. It is self-checking, with an optional Modulo 43 check digit. - **Applications**: Mandated under military standard **MIL-STD-129**, automotive manufacturing (AIAG), and medical equipment tracking.

QR Code: Omnipresent 2D Engagement Matrix Created in 1994 by Denso Wave, the **Quick Response (QR) Code** is the leading 2D matrix symbology. - **Capacity**: Stores up to 7,089 numeric or 4,296 alphanumeric characters. - **Readability**: Three corner finder patterns enable 360-degree scanning from any angle. - **Error Correction**: Four Reed-Solomon tiers (L: 7%, M: 15%, Q: 25%, H: 30%) restore data if damaged. - **Applications**: Marketing landing pages, mobile payments, menus, and authentication.


3. Technical Comparison

SymbologyFormatCharacter SetData CapacityPrimary Use CaseError Detection
Code 1281D LinearFull 128 ASCII80-100 charsFreight and logisticsModulo 103 checksum
UPC-A1D LinearNumeric (0-9)12 fixed digitsUS/Canada retail POSModulo 10 check digit
EAN-131D LinearNumeric (0-9)13 fixed digitsGlobal retail POSModulo 10 check digit
Code 391D LinearUppercase, digits, symbolsVariable (low density)Defense and automotiveSelf-checking, optional Mod 43
QR Code2D MatrixAlphanumeric, binaryUp to 7,089 numbersMobile web and paymentsReed-Solomon (7% to 30%)

4. How Check Digits Work: The Modulo 10 Algorithm

Retail linear barcodes rely on an algorithmic Modulo 10 checksum to prevent scanners from accepting transposed digits.

Calculating an EAN-13 Check Digit For an item with initial 12 digits `890123456789`: 1. **Sum odd-positioned digits**: `8 + 0 + 2 + 4 + 6 + 8 = 28` 2. **Sum even-positioned digits and multiply by 3**: `(9 + 1 + 3 + 5 + 7 + 9) * 3 = 102` 3. **Add results**: `28 + 102 = 130` 4. **Calculate check digit**: Since 130 is already a multiple of 10, the check digit is `0`. The complete 13-digit code is `8901234567890`.

Generating codes via the Barcode Generator computes this checksum automatically in browser memory.


5. Step-by-Step Implementation Guide

Follow these steps when selecting and printing barcodes:

  • Match Symbology to Scanning Environment: Use UPC-A or EAN-13 for consumer retail checkout. Use Code 128 for shipping cartons and warehouses. Choose QR codes when mobile smartphone scanning is needed.
  • Review Data Structure: Pure numbers work with retail formats. Alphanumeric serials require Code 128 or QR codes.
  • Maintain Quiet Zones: Keep an unprinted margin equal to 10 times the narrowest bar width on both ends of a 1D barcode. For QR codes, leave a 4-module border.
  • Generate Lossless Assets: Use the Barcode Generator or QR Code Generator to export crisp PNG files at 300+ DPI. Avoid lossy JPEG compression that blurs edges.
  • Verify with Physical Hardware: Scan printed samples under warehouse and retail lighting with handheld scanners before mass production.

6. Practical Tips for Optimal Print Reliability

  • Maintain Optical Contrast: Print dark bars against opaque white backgrounds. Avoid red or brown tones because red laser scanners cannot detect red print.
  • Lock Aspect Ratios: You can increase the vertical height of 1D bars to ease scanning, but never stretch or compress barcodes horizontally without proportional scaling.
  • Compensate for Ink Bleed: In thermal and wet ink printing, ink spreads into paper fibers. Adjust bar width reduction settings to keep bar spacing accurate.

Conclusion

Understanding the mechanical differences between Code 128, UPC-A, EAN-13, Code 39, and QR codes ensures your products scan reliably across retail registers, shipping docks, and customer workflows. Choosing the right format and adhering to print standards eliminates scanning failures and streamlines operations.

Create clean, print-ready barcodes with the Barcode Generator or generate dynamic 2D codes with the QR Code Generator directly in your browser on Resizer Tools.

Try Resizer Tools Web Workspace

Explore 41+ browser-native, offline PDF and image utilities.