UPC-A และ UPC-E: บาร์โค้ดสินค้าอเมริกาเหนือ
Technical guide to UPC-A and its zero-suppressed companion UPC-E — encoding rules, conversion algorithms, and the UPC-to-EAN migration.
UPC-A & UPC-E: North American Product Barcodes
The Universal Product Code (UPC) was the first barcode symbology adopted for retail checkout, scanned for the first time on June 26, 1974. UPC-A is the full 12-digit format, while UPC-E is a compressed 8-digit version for small packages.
UPC-A Structure
UPC-A encodes exactly 12 numeric digits:
- Digit 1: Number system (0 = standard, 2 = variable weight, 3 = drug, 5 = coupons)
- Digits 2-6 or 2-11: Company prefix + item reference
- Last digit: Check digit (Modulo 10)
The physical symbol is structurally identical to EAN-13 with a leading zero. A UPC-A barcode scanned by an EAN-13 reader returns 13 digits (0 + 12 UPC digits).
UPC-E: Zero Suppression
UPC-E compresses a 12-digit UPC-A into 8 digits by removing zeros from the middle according to specific rules. This creates a barcode roughly half the width of UPC-A, suitable for small packages like chewing gum and lip balm.
Zero suppression rules depend on the last digit of the manufacturer code:
| Rule | Condition | Example UPC-A | UPC-E |
|---|---|---|---|
| 0-2 | Manufacturer ends 00-20 | 0-12000-00453-X | 01245300 |
| 3 | Manufacturer ends X00 | 0-12300-00045-X | 01234500 |
| 4 | Item ref 00005-00009 | 0-12340-00005-X | 01234500 |
| 5-9 | Item ref ends 5-9 | 0-12345-00008-X | 01234580 |
Converting Between UPC-E and UPC-A
Every UPC-E can be expanded back to its UPC-A equivalent using the reverse of the suppression rules. This is important for database systems that store GTINs in their full form.
UPC Number System Digits
| Digit | Meaning |
|---|---|
| 0, 1, 6-9 | Standard UPC |
| 2 | Variable-weight items (in-store use) |
| 3 | National Drug Code |
| 4 | In-store use (no GS1 prefix required) |
| 5 | Coupons |
The UPC-to-EAN Migration
In 2005, all US and Canadian retailers were required to upgrade their scanners to read 13-digit EAN-13 barcodes. This effectively made UPC-A a subset of EAN-13. New products can be assigned either UPC-A or EAN-13 numbers through GS1.
Practical Considerations
- UPC-A remains the dominant format for products sold primarily in North America
- When selling internationally, ensure your trading partners accept 12-digit GTINs (most systems zero-pad to 13)
- UPC-E is recommended only when package size genuinely cannot accommodate UPC-A
- Always print with the human-readable digits in the OCR-B font, split into groups matching the number system, manufacturer, item, and check digit