10.

The Universal Product Code

Supermarkets know better than to trust us anarchists. It is easy enough to take a magic marker and black out a line or two of the Universal Product Code symbol. Lest anyone try to lower prices or sabotage the system, there is a security device built into the code.

The UPC scanner can detect any alteration of a symbol—or, at least, stands a 90 percent chance of detecting it. The secret is a “check digit” encoded in two extra bars at the end of the UPC symbol. The check digit is derived mathematically from the information contained in the other bars of the symbol. Change the symbol, and the check digit probably no longer jibes.

The formula for assigning the check digit was devised by the Uniform Product Code Council, a manufacturers’ association based in Dayton, Ohio. It is revealed in The UPC Guidelines Manual, a technical bulletin provided to corporate members of the council. Every manufacturer using the Universal Product Code calculates the check digit in the same way.

In its usual form, the code symbol has a number at the left side of the bar pattern and two groups of five digits at the bottom of the bar pattern. A shorter form of the symbol, with only six digits at the bottom, is used on packages too small to take the full symbol. A few products, such as magazines and books, have extra numbers and bars to accommodate large numbers of products from a single manufacturer.

The scanners do not read the numerals. The numerals are there

How to Crack the Universal Product Code

A Two thin “guard bars” don’t mean anything; they frame the real message. Repeated in middle and at other end of bar pattern.

B Wide space, bar, narrow space, thin bar encode the 0 at left of symbol. 0 means it’s regular groceries. 3 is for drugs.

C Ten spaces and ten bars encode the 12345 at bottom, which identifies the manufacturer. 21000 would be Kraft, etc.

D Encodes the 67890, which identifies the product, including size of package. Price is not encoded.

E A secret “check digit” (here 5) to catch any error or tampering. If someone widens a bar with a felt-tip pen, the check digit helps the scanner detect it.

only for the convenience of the human checkers. If the scanner is down, the checker may enter the numbers by hand. The bars encode the same set of numbers—plus the check digit—in a form that can be read by machine. The check digit is always a whole number from 0 to 9. It is not usually printed in numeral form. (On the few packages where the check digit is printed out, it is smaller than the other digits and appears below the two bars that encode it.)

The other digits of the code are assigned simply enough. The lone digit to the left of the bar pattern is the “number system character.” A “0” means the item is an ordinary grocery item; “2” is used for variable-weight items, such as meat and produce; “3” is for drugs and health-related items; “5” is for cents-off coupons.

The first cluster of five digits at the bottom encodes the manufacturer. For instance, 43000 is General Foods; 37000 is Procter & Gamble; 11141 is A&P house brand; 51000 is Campbell Soup. The second cluster of five digits specifies the product and size of package. These five digits are assigned by the manufacturers individually. If 20043 means a ten-ounce can of tomato soup for one manufacturer, it needn’t mean tomato soup for another manufacturer.

Once a product is encoded as a number, the next step is to encode the number in a bar pattern. The bar pattern can vary in size; 0.816 inch by 1.175 inches is the minimum; 2.040 inches by 2.938 inches is the maximum. The dark bars may be almost any dark color (not red). The background may be white or pastel.

The first two bars, reading from left to right, signify nothing. They are a sort of punctuation to let the scanner know where to start reading. The same is true for the two bars in the middle, which extend down between the two clusters of visible digits, and for the two bars at the extreme right.

The first two bars to the right of the first set of punctuation bars encode the number system character, the visible digit at left center. If this digit is a zero, there is a space, then a thick bar, then a narrow space, then a narrow bar: the bar code for zero.

Each of the other digits also appears as two bars and two spaces. The portion of the UPC symbol allotted to each digit is composed of seven equal units or “modules,” each of which may be either dark or light. The symbol for zero is three light modules (the space), two dark modules (the thick bar), one light module(the narrow space), and one dark module (the narrow bar). This is represented as 0001101, where the 0s are light modules and the Is are dark modules.

A reversed version of this code is used for the part of the UPC symbol to the right of the two thin bars in the center. A zero appearing on the right becomes 1110010—that is, a thick bar, a space, a narrow bar, a narrow space. Two different codes are used so that the scanner will be able to recognize which side of the symbol it is reading. In this way, packages do not have to be fed to the scanner in one direction only.

The complete code is:

The check digit, appearing at the far right, is encoded according to the right-side column above. Two narrow bars separated by a triple-wide space signifies a 7, for instance.

Some typical codes, along with their check digits, are as follows:

Ann Page Black Pepper, 2 oz. 0 11141 26230 1

Ronzoni Spinach Fettuccine, 12 oz Campbell’s Spanish Style 0 71300 00137 0

Vegetable Soup,10½ oz. 0 51000 02677 4

The formula? Take the digits of the code (aside from the check digit, of course) and group them according to their sequence in the code. Write the first digit, third digit, fifth digit, etc.—the odd sequence—on one line and the second digit, fourth digit, etc.— the even sequence—below it:

Then add each sequence of digits,

0+1+4+2+2+0=9
1 + 1 + 1+ 6 + 3= 12

multiply the sum of the odd sequence by 3,

9 × 3 = 27

and add the result to the sum of the even sequence,

27 + 12 = 39

Subtract this result from the next higher multiple of 10. Here 40 is the next higher multiple of 10:

40-39 = 1

The remainder, 1, is the correct check digit.

Changing any single digit of the code will require a different check digit. In no case could a person with a marking pen expect to change a code to that of a lower-priced item; the best one could do would be to change a code randomly. Perhaps the altered code would be a cheaper item; perhaps it would be more expensive; perhaps it would be an unassigned code. The check digit ensures that any simple alteration will be caught, even if the altered code is an assigned one.