
Extrapolated Barcode Specs |
Compiled by Nick Johnson. |
As several people have pointed out, UPC is not EAN; rather, UPC is a subset of EAN.
I had to figure these out by gathering every product I could find in my apartment that had a UPC symbol on it and doing a lot of clever things to find the patterns.
Here is a table describing the left and right sides of the barcode, using the numbers 1-4 to denote bar width and A-D to denote space width:
| Number | Code for Left | Code for Right |
|---|---|---|
| 0 | B2A1 | 3B1 |
| 1 | A2B1 | 2B2 |
| 2 | A1B2 | 2A2A |
| 3 | 4A1 | 1D1 |
| 4 | 1C2 | 1A3A |
| 5 | 2C1 | 1B3 |
| 6 | 1A4 | 1A1C |
| 7 | 3A2 | 1C1A |
| 8 | 2A3 | 1B1B |
| 9 | B1A2 | 3A1A |
Each digit is a fixed width; if you add the width values for any digit, the sum will be 6. The common density appears to be 96 XPI (X-dimensions per inch) or 16 patterns per inch. Each is also followed by an X-dimension space which I left out of the table entries. (B2A1 becomes B2A1A).
A UPC Barcode uses as a check digit a quirky Modulo 10 scheme. The odd numbered digits are multiplied by 3 and added to the even digits. These two numbers are added, and the checksum is equal to the number that would have to be added to this sum to equal the next even multiple of 10. For example, off my can of Coke, the UPC is 496340, so 3(4+6+4) + (9+3+0) = 54. The next multiple of 10 is 60, so the check digit is 6.
Note that by "odd" and "even" I mean "positionally-odd" and "positionally-even"; the odd-numbered digits are in the first, third, fifth, and so-on positions, and the evens are in the second, fourth, sixth, etc.
In addition to the data fields, an EAN code contains a start/stop/center character of the format 1A1A, the only symbology that doesn't conform to the 6-width rule. This is found at the beginning and ending of the symbol and in the center if it is a divided symbol.
UPC symbols are a subset of EAN. They contain a barcode type value, 6 or 10 data values, and an EAN checksum. The first 5 data values on a 10-digit barcode combine to make the manufacturer code and the last 5 are the product code. The barcode type is almost always 0. It is considered in the checksum. 6 and 7 are other common types.
On some products, a compressed upc symbol is used that only contains 6 data digits. On these symbols, only the left side codes are used and there is no center marker. In addition, the barcode type value is absent (although a 0 is often printed where it would be placed).
There are some who believe that UPC symbols either are or that they contain "the mark of the beast", 666. This is a misconception based on the start, stop, and middle dividers appearing to be similar to the right-side 6 pattern. This is technically inaccurate, since these patterns are 4-wide, not 6-wide as the digits are; further, there are 2 patterns for each digit, and the compressed UPC doesn't use the right-side 6 pattern at all.
If you want to get a manufacturer ID for yourself, take a look at the Uniform Code Council's site. Only they can issue you a proper manufacturer code.
You can make a UPC code by entering 7, 8, 11 or 12 digits of the code.
If you enter the first 7 or 11 digits only, the checksum will be calculated.
|
Codabar |
Code 2 of 5 |
Code 3 of 9 |
Interleaved 2 of 5 |
|
Postnet |
UPC |
Code 128 |
Code 16k |
|
|
|
|
| Thu Jul 24 11:02:53 PDT 2008 | barcode/upc.src | Updated: Thu Aug 18 2005 9:31.35 | Viewed: never |