What the 12 digits of a UPC-A mean
A UPC-A barcode encodes exactly 12 digits: a GS1 company prefix, an item reference chosen by that company, and one check digit. The prefix length varies — a large brand has a short prefix and room for many products, a small business a longer one. Together the first 11 digits identify one product in one size or variant; the 12th only protects against reading errors.
| Part | Example (036000291452) | Who sets it |
|---|---|---|
| Company prefix + item reference | 03600029145 | GS1 assigns the prefix; the company numbers its items |
| Check digit | 2 | Calculated from the first 11 digits |
In the bars, the 12 digits are split into a left and a right half of six digits each, framed by guard bars at the start, middle and end. Each digit is drawn as two bars and two spaces, seven modules wide. Left-half digits use patterns with an odd number of dark modules and right-half digits an even number, which lets a scanner tell which way round it is reading the code.
Work out a check digit by hand
- Write the 11 digits: 0 3 6 0 0 0 2 9 1 4 5.
- Add the 1st, 3rd, 5th, 7th, 9th and 11th digits: 0 + 6 + 0 + 2 + 1 + 5 = 14. Multiply by 3: 42.
- Add the 2nd, 4th, 6th, 8th and 10th digits: 3 + 0 + 0 + 9 + 4 = 16.
- Total: 42 + 16 = 58. The next multiple of 10 is 60, so the check digit is 60 − 58 = 2.
The generator does this for you, but the method helps when you need to check a number someone sent you.
Printing UPC barcodes
- Size: the standard UPC-A symbol is about 37 × 26 mm. GS1 allows it to be scaled roughly between 80% and 200%; going smaller or cutting the height makes scanning less reliable.
- Margins: keep the white space on both sides of the bars — it is part of the barcode.
- Colour: dark bars on a light background. Red or orange bars are invisible to many laser scanners.
- Test it with the barcode scanner or a phone before you print a full run.