UPC (Universal Product Code) was the original barcode symbology widely used in America for items in stores, nowadays replaced by

**EAN.UCC-12**, that encodes twelve digits as follows:

SLLLLLLMRRRRRRE

where S and E are the bit pattern 101, M is the bit pattern 01010, and L and R are digits, seven bits long each. This is a total of 95 bits.

The first L digit is 0 for ordinary items, 3 for pharmaceuticals, 2 for random-weight items, and 5 for coupons. The rest of L is the manufacturer code. The first five R digits are the product code assigned by the manufacturer. The last digit is a redundancy check.

Each digit has four forms, of which two are used in UPC-A and three in EAN. For 6, the forms are:

0101111 (L)

0000101 (L in EAN)

1010000 (R)

1111010 (unused)

The codes for the ten digits are:

0 0001101

1 0011001

2 0010011

3 0111101

4 0100011

5 0110001

6 0101111

7 0111011

8 0110111

9 0001011

Company prefixes are assigned by EAN-UCC.