UPC-A Validator
Validate UPC-A (12-digit) barcode used in US/Canada retail.
UPC-A validation: the original American supermarket barcode
The UPC-A (Universal Product Code, Version A) is the 12-digit retail barcode that started it all. Invented in 1973 by George Laurer at IBM, it was first scanned at a Marsh Supermarket in Troy, Ohio on 26 June 1974 — a 10-pack of Wrigley's Juicy Fruit chewing gum, now on display at the Smithsonian. The standard is published as ISO/IEC 15420 alongside EAN-13, and the numbering plan is administered by GS1 US, the American branch of the global GS1 organisation. Validating a UPC-A means three things: the length is exactly twelve digits, every character is 0-9, and the last digit matches the mod-10 check computed from the first eleven.
UPC-A is the dominant retail format in the United States and Canada. Outside North America it has been largely superseded by its 13-digit sibling EAN-13, but every modern PoS scanner reads both transparently — UPC-A is mathematically a subset of EAN-13, you just prepend a leading zero.
Anatomy of a UPC-A
The twelve positions split into 1 GS1 prefix digit (a.k.a. number system character, 0-9) + 5 manufacturer digits (allocated by GS1 US to the brand owner) + 5 product reference digits (chosen by the manufacturer) + 1 check digit. The original UPC spec carved 5-and-5 fixed, but GS1 later flexibilised the cut so larger brands can have shorter product fields and vice versa.
- 0, 1, 6, 7, 8, 9 — general groceries and merchandise.
- 2 — variable-weight items generated in-store (deli, butcher, produce by weight).
- 3 — pharmaceuticals and NDC (National Drug Code) mapping.
- 4 — non-food items, in-store generated.
- 5 — coupons.
The mod-10 check digit (alternating 3-1 weights)
Take positions 1 to 11 from left to right. Multiply the odd positions (1, 3, 5, 7, 9, 11) by 3 and the even positions (2, 4, 6, 8, 10) by 1. Sum the eleven products, take the remainder modulo 10, and the check digit is (10 - remainder) mod 10. The outer mod 10 covers the edge case where the remainder is 0.
// 036000291452 — Coca-Cola Classic 12 oz can (US)
digits = [0,3,6,0,0,0,2,9,1,4,5]
sum = 0*3 + 3*1 + 6*3 + 0*1 + 0*3 + 0*1
+ 2*3 + 9*1 + 1*3 + 4*1 + 5*3
= 0+3+18+0+0+0+6+9+3+4+15 = 58
dv = (10 - 58 % 10) % 10 = (10 - 8) % 10 = 2
// UPC-A: 036000291452
Note this is the same family of mod-10 algorithm used by EAN-13, ITF-14 and GTIN — they all share the alternating 3-1 weighting; only the digit count and starting position differ.
UPC-A vs EAN-13, UPC-E and ITF-14
EAN-13 is a strict superset of UPC-A: 036000291452 (UPC-A) is the same product as 0036000291452 (EAN-13). Conversion is purely cosmetic — prepend a zero. UPC-E is the 8-digit zero-suppressed variant for very small packages where there is no room for the full bar pattern; it expands back to UPC-A by inserting zeros according to a fixed table. ITF-14 wraps a UPC-A or EAN-13 inside a 14-digit shipping container code by prefixing an indicator digit and recomputing the check. For Brazilian exporters shipping to the US, the conversion path is usually EAN-13 with 789 prefix for the domestic SKU and a separate UPC-A allocated by GS1 US if the buyer requires American codes — although most US chains today accept the 789 EAN.
Brazilian export context: GS1 Brasil and the North American buyer
Brazilian manufacturers selling on Amazon.com, Walmart.com or Target.com have two choices: list with their GS1 Brasil 789/790 EAN-13 (accepted by most US marketplaces) or register a separate UPC-A through GS1 US (mandatory for some big-box retailers that still parse 12-digit fields only). The export-oriented sectors most affected are cosmetics (Natura, O Boticario), coffee (3 Coracoes, Melitta), food (Tipiti, Pacha Mama) and fashion (Havaianas). Magazine Luiza, Mercado Livre and the rest of the Brazilian retail stack continue to operate on EAN-13 internally — UPC-A is only relevant when crossing the border.
Common pitfalls and anti-patterns
- Treating UPC-A and EAN-13 as the same string: they are mathematically related but stored differently. Most databases keep both columns and trust the application layer to convert.
- Treating UPC-A and ISBN-10 as similar: ISBN-10 uses a completely different check (mod 11 with weights 10-1, allowing X as a digit). They are not interchangeable.
- UPC-E expansion: never store a UPC-E without also recording the expanded UPC-A — round-trip ambiguity exists if the manufacturer prefix has trailing zeros.
- Free lookup APIs:
upcitemdb.com,barcodelookup.comandgo-upc.comoffer free tiers but coverage is uneven; do not assume "not found" means "invalid". - Number system 2 in production: a UPC-A starting with
2is generated in-store for variable-weight items. It is not portable across stores.
FAQ
Is UPC-A only used in the United States? Primarily the US and Canada. Mexico straddles UPC-A and EAN-13. Outside North America, EAN-13 dominates — though every modern scanner reads UPC-A regardless.
Did EAN-13 replace UPC-A? Logically yes (EAN-13 is the superset), but UPC-A is alive and well in North American retail. ISBNs, however, have fully migrated to the 13-digit form (Bookland EAN-13 with 978/979 prefix).
Are there free UPC lookup services? Yes — upcitemdb.com is the most popular free option. For authoritative ownership data, query the GS1 GEPIR (Global Electronic Party Information Registry) at gepir.gs1.org.
Can I convert a UPC-A to an EAN-13 manually? Yes — prepend a 0. The check digit is identical. To go the other way, drop the leading zero (only valid if the EAN-13 starts with 0).
Does a valid check digit prove the product exists? No. The math only proves internal consistency. To confirm registration, query GS1 GEPIR or one of the public UPC databases.
Related Tools
EAN-13 Checksum Validator
Validate an EAN-13 barcode (13 digits) by its official check digit. Essential for retail, inventory control and product registration.
EAN-8 Checksum Validator
Validate an EAN-8 barcode (8 digits) by checking the check digit with the official algorithm. Useful for small products, retail and inventory control.
EAN-13 Validator
Validate EAN-13 (13-digit) retail barcode.