UPC-A complete reference: encoding, check digit, UPC-E, and the dead variants
The 12-digit UPC-A symbol explained from modules to mod-10 check digit. Full L and R encoding tables, UPC-E zero-suppression rules with worked example, the UPC-B/C/D variants nobody uses, and where the GS1 prefix system came from.
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 proposals from RCA, Singer, Litton, Pitney Bowes, Plessey, Charegon and others 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 and the 2- and 5-digit supplements, is detail.
This page is the detail. It gives the encoding patterns, the expansion rules and the check digit calculation with the figures from ISO/IEC 15420 and the current GS1 General Specifications, and it says where older sources differ from them.
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 to 6, or up to 10 | Rest of the GS1 Company Prefix, which is 6 to 10 digits in total | Manufacturer code (5 fixed digits) |
| 7 to 11, or fewer | Item reference, the 1 to 5 digits left after the prefix | Item reference (5 fixed digits) |
| 12 | Mod-10 check digit | Mod-10 check digit |
The 5+5 split is dead. The original 1973 design was 1 system digit + 5 manufacturer + 5 item + 1 check. Since February 2000, GS1 US (then the Uniform Code Council) has issued variable-length Company Prefixes of 6 to 10 digits, with the item reference taking whatever digits are left over. A small brand might have a 10-digit prefix and one item digit, so ten products. A large brand might have a 6-digit prefix and 5 item digits. A brand that needs only a few numbers can buy single GTINs instead, one number at a time. The first digit keeps its categorical meaning because GS1 reserves prefix ranges that way, but the rigid 5+5 split is historical.
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. |
| 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. |
| 7 | Standard UPC Company Prefix. |
| 8 | Standard UPC Company Prefix. |
| 9 | Standard UPC Company Prefix. |
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 an allowed range of 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 out of conformance. Many old scanners read truncated symbols anyway, but production printing should not rely on that.
The quiet zone is the blank margin to either side. The GS1 General Specifications and ISO/IEC 15420 specify a minimum of 9X (9 modules) on each side of UPC-A.
L-codes and R-codes
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 and 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.
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. If your check digits do not match what GS1 publishes, count from the right.
The full procedure for UPC-A has four steps.
- 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, so the check digit is 0.
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 GS1 US prefix (036000), used by Kimberly-Clark. 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.
The same algorithm with the position weights flipped is in the EAN-13 check digit guide. The two 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 (>=7X)
| 101 | 6 digits x 7 modules | 010101 |
3 + 42 + 6 = 51 modules
Each digit still takes 7 modules, the same as UPC-A. The saving comes from omitting the center guard and the right half. The quiet zone is 9X on the left and 7X on the right.
Eligibility. GS1 compresses only GTIN-12s that begin with NSC 0, and only those whose digit pattern follows one of four specific templates. Some scanners also accept a non-standard NSC 1 form, called UPC-E1, which GS1 does not approve, so test scanner support before you rely on it.
The expansion rules. Given a 6-digit UPC-E body d1 d2 d3 d4 d5 d6 and an NSC of N (0, or 1 in the non-standard UPC-E1 form), the rule for converting back to a 12-digit UPC-A depends on d6.
| If d6 is | Expanded UPC-A is | Rule |
|---|---|---|
| 0, 1, or 2 | N d1 d2 d6 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 d4 d5 C | Manufacturer = first 3 digits + 00. Item = 000 + d4 d5. |
| 4 | N d1 d2 d3 d4 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 and d6=4 rules are different. d6=3 inserts five zeros between d3 and d4; d6=4 inserts five zeros between d4 and d5. An expander that conflates the two returns the wrong UPC-A for every code that uses either rule.
Worked expansion of 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, and the manufacturer code 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 the patterns are as follows.
| 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 the non-standard NSC 1 form (UPC-E1), the parity pattern is the bitwise inverse, so 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 only, narrow digit patterns) limit which codes compress, the parity scheme is fragile under print errors, and modern small-package products should default to EAN-8, which has cleaner allocation, broader international support, and fewer compatibility caveats. UPC-E stays in use for the legacy stock that already exists, and EAN-8 fits the same space for anything new.
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. It has two data digits and 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 uses the weighting check = ((d1 + d3 + d5) * 3 + (d2 + d4) * 9) mod 10, and the check value 0-9 selects a parity pattern across the five digits. The values you see on books encode a currency and a price.
90000- no suggested price.5XXXX- USD price. The leading 5 means United States dollars and the remaining 4 digits are the price in cents (51999= US$19.99).- Other leading digits encode the currency, with 0 or 1 for GBP, 3 for AUD, 4 for NZD and 6 for CAD (Bowker and International ISBN Agency conventions).
The dead variants UPC-B, UPC-C and UPC-D
The original 1970s UPC documentation listed three variants beyond UPC-A and UPC-E. None are in any current standard, and none have a documented production deployment past the 1990s. The specifications were published; no deployment of any of them is recorded.
- UPC-B had 12 digits and no check digit. It was specified for the National Drug Code (NDC) and National Health Related Items Code (NHRIC). In practice, pharmaceutical adoption settled on standard UPC-A with NSC = 3 instead. The FDA Bar Code Rule (21 CFR 201.25), effective in 2004 with full compliance required by April 2006, requires a linear barcode containing the NDC on prescription drug labels. NSC 3 UPC-A is the common implementation, not the mandated one.
- UPC-C was a 12-digit code with a number system digit and a check digit. No current standard references it and no production deployment is documented.
- UPC-D was variable length, 12 digits or more with a check digit, and met the same fate. The industrial niche it was meant to serve was absorbed by Code 39 (1974), Code 128 (1981), and GS1-128 (1991), which gave variable-length numeric and alphanumeric coding without requiring GS1 prefix registration.
The primary historical source for all three was George Laurer's personal site, barcode-1.net, which documented what was specified and is no longer online. Their absence from current standards is complete. ISO/IEC 15420 does not mention them, the GS1 General Specifications do not mention them, and AIM's current symbology list does not include them.
UPC-A as GTIN-12, padding, EAN-13 and Sunrise 2005
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 a matter of prepending 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 buy-or-print decision is in the UPC vs EAN guide, and the GS1 prefix purchase question is in do I need GS1 UPC codes.
Why the bullseye lost the 1973 selection
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 symbology proposals from these firms, among others.
- 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 by print tolerance, and the evidence came from a live deployment. RCA had been operating a bullseye installation 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, common on flexible packaging and newsprint-grade label stock, caused adjacent rings to merge and destroyed 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 documented in Stephen Brown's Revolution at the Checkout Counter (Harvard University 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, purchased by customer Clyde Dawson. A facsimile of the pack is displayed at the Smithsonian's National Museum of American History.
Standards and where to verify
| Standard | Status | Scope |
|---|---|---|
| ISO/IEC 15420:2025 | Current (third edition, 2025) | The international symbology standard for UPC-A, UPC-E, EAN-13, EAN-8, and the 2- and 5-digit supplements. |
| GS1 General Specifications (Release 26.0, January 2026) | Current; updated annually | The application standard for GTIN allocation, prefix assignment, application identifiers and packaging. EAN/UPC symbology is in section 5.2, the check digit in 7.9, UPC-E zero-suppression in 7.10. |
| FDA 21 CFR 201.25 (Bar Code Rule) | Effective 2004, full compliance by April 2006 | US federal rule requiring a linear barcode that encodes the NDC on prescription drug labels. Commonly 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 February 2000, GS1 US issues variable-length 6-10 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. |
| "UPC-E expansion d6=3 and d6=4 are the same." | The two rules differ. d6=3 inserts five zeros between d3 and d4; d6=4 inserts five 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." | The GS1 General Specifications and ISO/IEC 15420 specify 9X minimum on each side of UPC-A. 7X is the right-hand quiet zone of UPC-E and EAN-13. |
| "UPC-E supports any UPC-A." | No. Only NSC 0 (plus the non-standard NSC 1 form, UPC-E1), 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.
Checked against GS1 General Specifications Release 26.0 and ISO/IEC 15420:2025.