Home · Learn · What Is a 12-Digit Barcode?
What Is a 12-Digit Barcode?
12 digits, used on every retail product in the US and Canada. The format has a specific name: UPC-A. Here's what those 12 digits mean.
A 12-digit barcode is almost always a UPC-A — the Universal Product Code adopted by US and Canadian retail in 1973. The 12-digit length is the defining feature: 11 data digits + 1 check digit computed via GS1 Mod 10. Every supermarket scanner, every Amazon US listing, and every Walmart retail SKU uses this exact format.
Outside North America, retail barcodes are 13 digits (EAN-13). Inside North America, both 12 and 13 digit barcodes work — a UPC-A is structurally a GTIN-12 and converts to GTIN-13 by prepending a zero.
Structure of the 12 digits
Position 1: number system digit (typically 0 for general consumer items, 2 for variable-weight, 3 for drug/pharmacy, 5 for coupons, 4 for in-store, 6/7/9 reserved). Positions 2-6: GS1 Company Prefix (varies in length per the assigned prefix tier). Positions 7-11: product reference assigned by the brand owner. Position 12: Mod 10 check digit computed from the first 11.
Why exactly 12?
Historical decision by George Laurer at IBM in 1973. He needed a barcode that retail scanners could read in any orientation at any speed, with built-in error detection. 12 digits (11 data + 1 check) was the longest that fit within the desired symbol size at the print densities feasible in 1970s offset printing. The 1976 European EAN-13 extension added a leading country-code digit, making it 13.
What a 12-digit barcode is NOT
12 digits is not always UPC-A. Other formats can hit 12: a Code 128 with numeric-only payload could be 12 digits. A truncated DataMatrix encoding 12 digits exists. But when consumers and retailers say '12-digit barcode' they specifically mean UPC-A — the linear retail barcode with the visible number string below the bars.
Where you see 12-digit barcodes
Every product sold at a US/Canada grocery, pharmacy, mass-market retailer, or big-box store. Amazon US retail listings. Costco shelf SKUs. Walmart Marketplace. Books published before 2007 (post-2007 books moved to 13-digit ISBN-13). Most products manufactured before about 2010 even in international markets still carry UPC-A on the original packaging.
FAQ
Is a 12-digit barcode a UPC?
Yes — a 12-digit retail barcode is a UPC-A, the standard US/Canada retail format. The 12 digits comprise 11 data digits + 1 Mod 10 check digit.
Can I generate a valid 12-digit barcode?
Yes — use the UPC-A generator at upcgen.com/generators/upc-a. Enter 11 digits and the check digit is computed automatically. For retail use, the underlying GTIN-12 number must come from a licensed GS1 Company Prefix; the barcode image itself is free to render.
Why are some retail barcodes 12 digits and others 13?
12 digits = UPC-A (US/Canada origin, 1973). 13 digits = EAN-13 (international, 1976 — extended UPC with a country code). Both encode a GTIN; modern scanners read either. International products entering the US market typically retain their EAN-13.
How is the 12th digit calculated?
GS1 Mod 10 algorithm. Sum the odd-position digits (1st, 3rd, 5th, etc. from the left) and multiply by 3. Add the sum of even-position digits. The check digit is (10 − (total mod 10)) mod 10.
Related generators
Need a real barcode now?
Generate a valid UPC-A barcode in seconds — no signup, no watermark. Free for casual use; paid plans from $9/mo for higher volume.