How the U.P.C. is Constructed

Used with permission. This Tutorial was created by George Laurer, the creator of the U.P.C. Barcode Symbol. Copyright ID History Museum 2007-2012 http://www.idhistory.com

Understanding the construction of the U.P.C. symbol starts with an understanding of the character sets used by the U.P.C. In order to encode the ten decimal digits in bars, a character structure consisting of seven modules of equal width is used for each character. Each charter must start with a white space and end with a black bar. Also each character must have two white spaces and two black spaces or bars. Figure #1 depicts a typical character.

There are twenty bar space patterns that satisfy the rules stated. Using the notation that a “0” represents a white module and a “1” represents black module, the twenty patterns are listed below along with the arbitrary digit assignments used in the U.P.C. code.

 

Odd Parity Patterns
Decimal Value
Even Parity Patterns
0001101
0
0100111
0011001
1
0110011
0010011
2
0011011
0111101
3
0100001
0100011
4
0011101
0110001
5
0111001
0101111
6
0000101
0111011
7
0010001
0110111
8
0001001
0001011
9
0010111
0101
Center pattern
Margin101
Guard bar pattern
010101
Version E end pattern
The left column patterns all have an odd number of black modules and is called the odd parity character set while the right column patterns all have an even number of black modules and are called the even parity character set. There are three more patterns used in the construction of a U.P.C. symbol. They are the center pattern which is only four modules wide, the guard bar pattern which is 3 modules wide but with the white margin of greater than four modules appears to the readers as a pattern which is greater than seven modules, and the end pattern for      Version E which is the same as the center pattern with one extra space and bar to facilitate amplifier gain adjustments.
The U.P.C. symbol is composed of two symmetrical halves allowing the symbol to be smaller. The two halves are distinguished by the scanner based on the parity pattern of the six characters. Six characters encoded with odd parity patterns is the left half of a Version A symbol and the country flag is “0”. Six characters encoded with even parity patterns is the right half of a Version A symbol. This is actually another level of parity which improves the integrity of the symbol. Any bar or space that is misread, i.e. read as one module larger or smaller than it actually is, will result in the scanner rejecting the scan since it is neither a right or left half of a symbol. Version E has three of the six characters encoded with odd parity patterns and three with the even parity patterns as does the left half of EAN-13.
The “Guard bar pattern” closes the open left end of the first character and often used to determine the start of a half symbol. The first bar is also helpful in setting the amplifier gain. The “Center pattern” defines the end of a half symbol and the direction in which it was scanned, i.e. guard bar to center or center to guard bar.
 
In order to save space the right half of the symbol is rotated 180 degrees and one center pattern used for both halves.