UPC-A is a 12-digit GTIN encoded in 95 modules of bars and spaces. It was designed by IBM's George Laurer in 1973, selected by the Uniform Grocery Product Code Council over six other proposals on April 3 of that year, and first scanned on a 10-pack of Wrigley's Juicy Fruit gum at a Marsh Supermarket in Troy, Ohio on June 26, 1974. Everything else - the L and R encoding tables, the mod-10 check digit, the UPC-E compression scheme, the long-dead UPC-B/C/D variants, the 2- and 5-digit supplements - is detail.
This page is the detail. It is meant to be the reference you reach for when you need a specific encoding pattern, an expansion rule, or a check digit calculation, without paying ISO for a copy of 15420 or downloading a 500-page GS1 General Specifications PDF. Where current standards and folklore disagree, this page sides with the current standards and tells you what the folklore got wrong.
The 12 digits and what each one means
A UPC-A is exactly 12 digits, left to right:
| Position | Role (current GS1 model) | Role (original 1973 model) |
|---|---|---|
| 1 | First digit of the GS1 Company Prefix; also the Number System Character (NSC) | Number System Character |
| 2-6 | Continuation of the GS1 Company Prefix (variable length) | Manufacturer code (5 fixed digits) |
| 7-11 | Item reference (length = 11 minus the prefix length) | Item reference (5 fixed digits) |
| 12 | Mod-10 check digit | Mod-10 check digit |
The 5+5 split is dead. Most explanations on the internet still say UPC-A is 1 system digit + 5 manufacturer + 5 item + 1 check. That was the original 1973 design. Since the early 2000s, GS1 has issued variable-length Company Prefixes from 6 to 11 digits, with the item reference taking whatever digits are left over. A small brand might have an 11-digit prefix and effectively zero item digits (one GTIN per prefix); a giant brand might have a 6-digit prefix and 5 item digits. The first digit retains its categorical meaning because GS1 reserves prefix ranges that way, but the rigid 5+5 split is historical. Treat it as such.
The first digit (the Number System Character) tells the scanner what kind of code this is:
| NSC | Meaning |
|---|---|
| 0 | Standard UPC Company Prefix - the default for retail items registered through GS1 US. |
| 1 | Standard UPC Company Prefix. Allocated when the 0 pool tightened in the 2000s. |
| 2 | In-store random-weight items (meat, produce, deli). Locally assigned by the retailer; not globally unique. |
| 3 | Drugs by National Drug Code (NDC) and National Health Related Items Code (NHRIC). The NDC sits in positions 2-11. |
| 4 | In-store, loyalty, or non-retail. Reserved for retailer-internal use; not globally unique. |
| 5 | Coupons (legacy). Largely replaced by GS1 DataBar coupon codes but still scanned. |
| 6 | Standard UPC Company Prefix. Allocated when 0 was running out. |
| 7 | Standard UPC Company Prefix. |
| 8 | Reserved. |
| 9 | Reserved. Some pre-GS1 manufacturer programs in the 1990s used 9 for extended-value coupons. That is no longer current. |
Wikipedia's claim that NSC 9 means "extended coupons" is historical, not current. The current GS1 General Specifications list 9 as reserved. Both statements are true at different points in time; only one is true now.
The 95-module structure
A module is one unit of bar or space - the smallest readable feature. UPC-A uses exactly 95 modules per symbol, plus quiet zones on either side:
QZ (>=9X) | LG (3) | L1 L2 L3 L4 L5 L6 (42) | CG (5) | R1 R2 R3 R4 R5 R6 (42) | RG (3) | QZ (>=9X)
| 101 | 6 digits x 7 modules | 01010 | 6 digits x 7 modules | 101 |
3 + 42 + 5 + 42 + 3 = 95 modules
Left guard 101, six left-side digits at 7 modules each (42), center guard 01010, six right-side digits at 7 modules each (42), right guard 101. The center guard is what gives a UPC its visual symmetry and what allows a scanner to read either half independently and reconstruct the code from a sweep that misses one end.
The X-dimension is the width of one module. UPC-A's nominal X at 100% magnification is 0.330 mm, with allowed range 0.264 mm to 0.660 mm corresponding to 80% to 200% magnification per ISO/IEC 15420 and the GS1 General Specifications. Symbol height at 100% is 25.91 mm (1.02 inches). Truncating the bars below the spec height is technically out of conformance and many old scanners scan it anyway, but production printing should not rely on that.
The quiet zone is the blank margin to either side. Current GS1 GenSpec and ISO/IEC 15420 specify a minimum of 9X (9 modules) on each side. Older AIM USS-UPC documents specified 7X; many third-party blogs still cite 7X. The current authoritative number is 9X.
L-codes and R-codes: how digits become bars
Each digit is encoded as a 7-module pattern of bars and spaces. Left-side digits use the L-code (odd parity), right-side digits use the R-code (even parity). 0 is space (light), 1 is bar (dark).
| Digit | L-code (left half, odd parity) | R-code (right half, even parity) |
|---|---|---|
| 0 | 0001101 | 1110010 |
| 1 | 0011001 | 1100110 |
| 2 | 0010011 | 1101100 |
| 3 | 0111101 | 1000010 |
| 4 | 0100011 | 1011100 |
| 5 | 0110001 | 1001110 |
| 6 | 0101111 | 1010000 |
| 7 | 0111011 | 1000100 |
| 8 | 0110111 | 1001000 |
| 9 | 0001011 | 1110100 |
Three properties hold for every digit:
- The R-code is the bitwise complement of the L-code. Every 0 becomes 1 and vice versa. This is what lets the scanner distinguish left half from right half regardless of read direction.
- L-codes have an odd number of 1 bits (odd parity); R-codes have an even number of 1 bits (even parity).
- Every L-code starts with 0 (a space, abutting the trailing bar of the left guard); every R-code starts with 1 (a bar).
EAN-13 adds a third pattern, the G-code - the mirror image of the R-code, used on the left side of EAN-13 to encode the implicit 13th digit through the parity sequence of the first six digits. G-code does not appear in UPC-A. This is the structural reason UPC-A is exactly an EAN-13 with a leading zero: when the leading digit of an EAN-13 is 0, its left-side parity pattern is LLLLLL (all odd), identical to UPC-A.
The mod-10 check digit
Every GS1 GTIN format - GTIN-8, GTIN-12, GTIN-13, GTIN-14 - uses the same mod-10 check digit. There is exactly one rule, and it is invariant across formats:
The rightmost data digit gets weight x3. Weights then alternate x1, x3 moving leftward.
That is the whole algorithm. Whether "odd positions from the left" or "even positions from the left" get x3 depends on the GTIN length:
- UPC-A (12 digits, even length): odd-from-left positions (1, 3, 5, 7, 9, 11) get x3; even-from-left positions (2, 4, 6, 8, 10) get x1. Position 12 is the check.
- EAN-13 (13 digits, odd length): odd-from-left positions (1, 3, 5, 7, 9, 11) get x1; even-from-left positions (2, 4, 6, 8, 10, 12) get x3. Position 13 is the check.
The two rules look opposite but they are the same rule counted from the other end. This is the single most error-prone topic in barcode literature - blogs and even some standards-adjacent documents flip the parity and produce off-by-one explanations. If your code does not match what GS1 publishes, count from the right.
The full procedure for UPC-A:
- Multiply digits at positions 1, 3, 5, 7, 9, 11 by 3.
- Multiply digits at positions 2, 4, 6, 8, 10 by 1.
- Sum the 11 products.
- Check digit =
(10 - (sum mod 10)) mod 10.
The outer mod 10 in step 4 handles the case where the sum is already a multiple of 10: a check digit of 0, not 10.
Worked example 1: 012345678905
This is the canonical teaching example used in GS1 training materials. Data digits 01234567890, check 5.
| Position | Digit | Weight | Product |
|---|---|---|---|
| 1 | 0 | x3 | 0 |
| 2 | 1 | x1 | 1 |
| 3 | 2 | x3 | 6 |
| 4 | 3 | x1 | 3 |
| 5 | 4 | x3 | 12 |
| 6 | 5 | x1 | 5 |
| 7 | 6 | x3 | 18 |
| 8 | 7 | x1 | 7 |
| 9 | 8 | x3 | 24 |
| 10 | 9 | x1 | 9 |
| 11 | 0 | x3 | 0 |
Sum = 85. 85 mod 10 = 5. Check digit = (10 - 5) mod 10 = 5. Verified.
Worked example 2: 036000291452
A real GS1 US prefix (036000), used by Kimberly-Clark and historically by Quaker Oats. Data 03600029145, check 2. Sum_x3 = 0 + 6 + 0 + 2 + 1 + 5 = 14, multiplied by 3 = 42. Sum_x1 = 3 + 0 + 0 + 9 + 4 = 16. Total = 58. 58 mod 10 = 8. Check = (10 - 8) mod 10 = 2. Verified.
Worked example 3: 885909918126
Apple Inc. company prefix 885909, used on USB cables and other small accessories. Data 88590991812, check 6. Sum_x3 = 8 + 5 + 0 + 9 + 8 + 2 = 32, x3 = 96. Sum_x1 = 8 + 9 + 9 + 1 + 1 = 28. Total = 124. 124 mod 10 = 4. Check = (10 - 4) mod 10 = 6. Verified.
Cross-reference: the same algorithm with a different position-weight mapping is in the EAN-13 check digit guide. The two algorithms are arithmetically identical; only the left-counted positions flip because EAN-13 has one more digit.
UPC-E: zero-suppression for small packages
UPC-E is what you print on a pack of gum or a lipstick tube where a full UPC-A will not fit. It compresses certain UPC-A codes into 6 visible data digits in 51 modules:
QZ (>=9X) | LG (3) | d1 d2 d3 d4 d5 d6 (42) | RG (6) | QZ (>=9X)
| 101 | 6 digits x 7 modules | 010101 |
3 + 42 + 6 = 51 modules
Note: 7 modules per digit, same as UPC-A. The savings come from omitting the center guard and the right half entirely - not from a different per-digit encoding.
Eligibility. Only UPC-A codes with NSC 0 or 1 can be compressed to UPC-E, and only those whose digit pattern follows one of four specific templates. The original 1970s spec allowed only NSC 0; NSC 1 was added when GS1 US ran out of NSC 0 prefixes. Some legacy POS systems still reject NSC 1 UPC-E codes - assume nothing about scanner support without testing.
The expansion rules. Given a 6-digit UPC-E body d1 d2 d3 d4 d5 d6 and an NSC of N (0 or 1), the rule for converting back to a 12-digit UPC-A is determined by d6:
| If d6 is | Expanded UPC-A is | Rule |
|---|---|---|
| 0, 1, or 2 | N d1 d2 d6 0 0 0 0 0 d3 d4 d5 C | Manufacturer = first 2 digits + d6 + 00. Item = 00 + d3 d4 d5. |
| 3 | N d1 d2 d3 0 0 0 0 0 0 d4 d5 C | Manufacturer = first 3 digits + 00. Item = 000 + d4 d5. |
| 4 | N d1 d2 d3 d4 0 0 0 0 0 0 d5 C | Manufacturer = first 4 digits + 0. Item = 0000 + d5. |
| 5, 6, 7, 8, or 9 | N d1 d2 d3 d4 d5 0 0 0 0 d6 C | Manufacturer = first 5 digits. Item = 0000 + d6. |
The d6=3 vs d6=4 distinction is where most blog posts go wrong. They are subtly different: d6=3 inserts six zeros between d3 and d4; d6=4 inserts six zeros between d4 and d5. If your UPC-E expander conflates the two, every fourth product code you handle will be wrong.
Worked expansion: UPC-E 123456 with NSC 0
d6 is 6, so the d6 in {5..9} rule applies. The expansion places d6 (6) in the item position with four leading zeros, manufacturer is the first 5 digits unchanged.
- Body
123456+ NSC 0. - Manufacturer code =
12345. Item reference =00006. - Pre-check UPC-A =
0 12345 00006 _(11 digits). - Compute the check digit on
01234500006: sum_x3 = 0+2+4+0+0+6 = 12, x3 = 36. Sum_x1 = 1+3+5+0+0 = 9. Total = 45. 45 mod 10 = 5. Check = (10 - 5) mod 10 = 5. - Final UPC-A =
012345000065.
The check digit you just calculated is what gets encoded into the UPC-E symbol via parity, not as a visible digit.
Parity encoding of NSC and check digit
UPC-E does not print the NSC or the check digit. Instead, the six visible digits are encoded with a mix of L-codes (odd parity) and G-codes (even parity, from the EAN-13 left side), and the pattern of L vs G across the six positions encodes both the NSC and the UPC-A check digit. For NSC = 0:
| UPC-A check digit | Parity pattern (positions 1-6) |
|---|---|
| 0 | E E E O O O |
| 1 | E E O E O O |
| 2 | E E O O E O |
| 3 | E E O O O E |
| 4 | E O E E O O |
| 5 | E O O E E O |
| 6 | E O O O E E |
| 7 | E O E O E O |
| 8 | E O E O O E |
| 9 | E O O E O E |
(O = odd parity / L-code, E = even parity / G-code.) For NSC = 1, the parity pattern is the bitwise inverse - every O becomes E and vice versa. The right guard pattern 010101 is what tells the scanner this is a UPC-E and not a truncated UPC-A.
Should you build new product lines on UPC-E in 2026? No. UPC-E is legacy. The eligibility constraints (NSC 0 or 1, narrow digit patterns) are real, the parity scheme is fragile to print errors, and modern small-package products should default to EAN-8, which has cleaner allocation, broader international support, and fewer compatibility caveats. Keep scanning UPC-E for the legacy stock that already exists; do not generate new UPC-E codes when an EAN-8 will fit.
UPC-2 and UPC-5: the supplements on books and magazines
The 2-digit and 5-digit add-on supplements appear immediately to the right of a primary UPC-A or EAN-13. They are never scanned alone; the scanner sees them only as adjuncts to a main symbol.
UPC-2 encodes a magazine issue number 0-99. Two data digits, no explicit check digit - the parity pattern of the two digits encodes a check value computed as the 2-digit number modulo 4:
| Value mod 4 | Parity (left, right) |
|---|---|
| 0 | O O |
| 1 | O E |
| 2 | E O |
| 3 | E E |
UPC-5 encodes a 5-digit value, used on books for suggested retail price and on some periodicals. The check is computed with an unusual weighting: check = ((d1 + d3 + d5) * 3 + (d2 + d4) * 9) mod 10. The check value 0-9 selects a parity pattern across the five digits. Common values on books:
90000- no suggested price.5XXXX- USD price, leading 5 means United States dollars; the remaining 4 digits are the price in cents (51999= US$19.99).- Other leading digits encode currency: 0/1 = GBP, 3 = AUD, 4 = NZD, 6 = CAD. (Bowker / International ISBN Agency conventions.)
UPC-B, UPC-C, UPC-D: the dead variants
The original 1970s UPC documentation listed three variants beyond UPC-A and UPC-E. None are in any current standard. None have a documented production deployment past the 1990s. Wikipedia's [failed verification] tag on the UPC-B claim is fair: the spec existed; the deployment did not.
- UPC-B: 12 digits, no check digit. Specified for the National Drug Code (NDC) and National Health Related Items Code (NHRIC). The reasoning was that the FDA database was authoritative and an additional check digit was unnecessary. In practice, pharmaceutical adoption settled on standard UPC-A with NSC = 3 instead. The FDA Bar Code Rule (21 CFR 201.25), in force since 2006, mandates linear barcodes containing the NDC on prescription drug labels - and the implementation is NSC=3 UPC-A, not UPC-B.
- UPC-C: 13 digits with check, intended for industrial / military supply. No current standards reference. No documented production deployment.
- UPC-D: variable length 12-16 digits with check. Same fate. The industrial niche it was meant to serve was absorbed by Code 39 (1974), Code 128 (1981), and GS1-128 (1989), which gave variable-length numeric and alphanumeric coding without requiring GS1 prefix registration.
The primary historical source for all three is George Laurer's personal site (barcode-1.net/laurer.htm), which documents what was specified. The current absence is documented by silence: ISO/IEC 15420 does not mention them, GS1 General Specifications does not mention them, AIM's current symbology list does not include them.
UPC-A is GTIN-12: padding, EAN-13, and the Sunrise 2005 sea change
GS1 defines four GTIN lengths, all using the same mod-10 check digit family:
| GTIN format | Symbol | Use |
|---|---|---|
| GTIN-8 | EAN-8 | Small consumer items where EAN-13 will not fit. |
| GTIN-12 | UPC-A or UPC-E (compressed) | North American retail (and increasingly anywhere). |
| GTIN-13 | EAN-13 | Global retail standard. |
| GTIN-14 | ITF-14, GS1-128 with AI (01), GS1 DataMatrix | Outer cartons, trade units, packaging hierarchy. |
Padding is trivial: prepend zeros. UPC-A 036000291452 becomes GTIN-13 0036000291452 and GTIN-14 00036000291452. The check digit does not change because leading zeros contribute zero to the weighted sum. This is what lets a single GTIN-14 database field accept any GTIN format.
Sunrise 2005 was the project, announced in 1997 and completed January 1, 2005, that required all US and Canadian POS systems to scan and process 13-digit EAN-13 codes alongside 12-digit UPC-A. Before Sunrise, US retailers commonly rejected 13-digit codes. After Sunrise, the distinction collapsed at the scanner level. UPC-A persists in North America for cosmetic and operational reasons:
- Path dependence. Decades of artwork files, label-printing software defaults, and item-master data fields locked to 12 digits.
- Visual familiarity. US buyers and consumers expect 12 digits printed under the bars.
- Retailer item-master rigidity. Some POS data-entry forms still validate UPC fields as exactly 12 digits and reject 13, even though the scanners attached to them read 13 fine.
None of those reasons are technical. If your product has any chance of international distribution, print EAN-13. The 12-vs-13 choice is cosmetic, and EAN-13 is universally readable in North America after 2005. The detailed buy-or-print decision is in UPC vs EAN: which do I need; the GS1 prefix purchase question is in do I need GS1 UPC codes.
The 1973 selection: why the bullseye lost
The Uniform Grocery Product Code Council convened an Ad Hoc Committee on a Uniform Product Code in 1970-71. By April 1973 the committee had received seven symbology proposals:
- RCA - bullseye (concentric rings), based on the 1949 Woodland-Silver patent that RCA had licensed.
- IBM - rectangular linear bars, designed by George Laurer.
- Singer.
- Litton Industries.
- Pitney Bowes (a circular variant).
- Plessey (UK).
- Charegon - an OCR-based proposal.
The committee selected IBM's design on April 3, 1973. The decision was driven primarily by print tolerance, and the evidence was real, not lobbying. RCA had been operating a live bullseye deployment at a Kroger in Cincinnati since July 1972, and the tightly-spaced concentric rings degraded badly under the printing technology of the era. Ink smearing or ink spread - very common on flexible packaging and newsprint-grade label stock - caused adjacent rings to merge, destroying the symbol. Laurer's linear bars degraded gracefully under the same conditions: smearing distorted bars equally along their horizontal length, and the scanner integrated across multiple horizontal scan lines to recover the signal. The Kroger data was presented to the committee. RCA's own field data hurt RCA's case.
Laurer's design won on engineering merit. The print tolerance argument is genuine and well-documented in Stephen Brown's Revolution at the Checkout Counter (Harvard Business School Press, 1997) and Roger Palmer's The Bar Code Book.
The first scan happened at 8:01 AM on June 26, 1974, at Marsh Supermarket in Troy, Ohio. Cashier Sharon Buchanan scanned a 10-pack of Wrigley's Juicy Fruit gum, UPC 028000113001, purchased by customer Clyde Dawson. The pack and the receipt are in the Smithsonian's National Museum of American History. Wrigley's was chosen because it was one of the first manufacturers to put UPCs on packaging.
Standards and where to verify
| Standard | Status | Scope |
|---|---|---|
| ISO/IEC 15420:2009 | Current | The international symbology standard for UPC-A, UPC-E, EAN-13, EAN-8, and the 2- and 5-digit supplements. |
| GS1 General Specifications (v25, 2025) | Current; updated annually | The application standard for GTIN allocation, prefix assignment, application identifiers, packaging, etc. UPC-A is in section 5.1; UPC-E in 5.2; check digit in 7.9. |
| AIM USS-UPC / USS-EAN/UPC | Superseded | 1990s industry-association specifications. Replaced by ISO/IEC 15420. |
| ANSI MH10.8.1 | Superseded for UPC | Older US material-handling barcode spec; still cited for some industrial codes. |
| FDA 21 CFR 201.25 (Bar Code Rule) | In force since 2006 | US federal mandate for linear barcodes encoding the NDC on prescription drug labels. Implemented as NSC=3 UPC-A. |
Common mistakes
| Mistake | Correction |
|---|---|
| "UPC-A is 5 manufacturer digits + 5 item digits." | That was the original 1973 design. Since the early 2000s, GS1 issues variable-length 6-11 digit Company Prefixes; the item reference fills whatever digits remain. |
| "Even positions get x3 in the check digit." | True for EAN-13, false for UPC-A. The invariant rule is "rightmost data digit gets x3". Whether odd or even left-counted positions get x3 depends on the GTIN length. |
| "UPC-E has its own check digit." | No. UPC-E encodes the UPC-A check digit through the parity pattern of its six visible digits, not as a separate digit. |
| "UPC-E expansion d6=3 and d6=4 are the same." | They are not. d6=3 inserts six zeros between d3 and d4; d6=4 inserts six zeros between d4 and d5. The manufacturer/item split shifts by one digit between the two rules. |
| "UPC = EAN." | UPC-A is structurally an EAN-13 with a leading zero. But UPC also includes UPC-E, UPC-2, and UPC-5, none of which have direct EAN equivalents. |
| "Quiet zone is 7X minimum." | Old AIM USS spec. Current GS1 General Specifications and ISO/IEC 15420 specify 9X minimum on each side. |
| "NSC 9 means extended coupons." | Historical only. Some pre-GS1 manufacturer programs used 9 for extended-value coupons in the 1990s. Current GS1 GenSpec lists 9 as reserved. |
| "UPC-E supports any UPC-A." | No. Only NSC 0 or 1, and only digit patterns matching one of the four expansion rules. Most UPC-A codes do not compress. |
| "UPC-A has 95 bars." | It has 95 modules. Modules are alternating bar/space units, and adjacent modules of the same type form a single visual bar. The number of distinct bars is far smaller than 95. |
To generate a verified UPC-A, use the UPC-A generator. For bulk encoding, the UPC-A batch tool takes a CSV of GTINs and returns rendered symbols.
Last verified against GS1 General Specifications v25.0 and ISO/IEC 15420:2009 on 2026-04-28.