The Universal Product Code (UPC) is a barcode symbology that is widely used in the United States, Canada, United Kingdom, Australia, New Zealand, in Europe and other countries for tracking trade items in stores.
UPC (technically refers to UPCA) consists of 12 numeric digits, that are uniquely assigned to each trade item. Along with the related EAN barcode, the UPC is the barcode mainly used for scanning of trade items at the point of sale, per GS1 specifications.^{[1]} UPC data structures are a component of GTINs and follow the global GS1 specification, which is based on international standards. But some retailers (clothing, furniture) do not use the GS1 system (rather other barcode symbologies or article number systems). On the other hand, some retailers use the EAN/UPC barcode symbology, but without using a GTIN (for products, brands, sold at such retailers only).
History
This article duplicates the scope of other articles, specifically, Barcode#History. (December 2013) 
Wallace Flint proposed an automated checkout system in 1932 using punched cards. Bernard Silver and Norman Joseph Woodland, a graduate student from Drexel Institute of Technology (now Drexel University), developed a bull'seye style code and applied for the patent in 1949.^{[2]}^{[3]}
In the 1960s, railroads experimented with a multicolor barcode for tracking rail cars, but they eventually abandoned it.^{[4]}
A group of grocery industry trade associations formed the Uniform Grocery Product Code Council which with consultants Larry Russell and Tom Wilson of McKinsey & Company, defined the numerical format of the Uniform Product Code.^{[5]} Technology firms including Charegon, IBM, LittonZellweger, Pitney BowesAlpex, PlesseyAnker, RCA, Scanner Inc., Singer, and Dymo Industries/Data General proposed alternative symbol representations to the council.^{[citation needed]} In the end the Symbol Selection Committee chose to slightly modify, changing the font in the human readable area, the IBM proposal designed by George J. Laurer.^{[citation needed]}
The first UPC marked item ever scanned at a retail checkout was at the Marsh supermarket in Troy, Ohio at 8:01 a.m. on June 26, 1974, and was a 10pack (50 sticks) of Wrigley's Juicy Fruit chewing gum.^{[6]} The shopper was Clyde Dawson and cashier Sharon Buchanan made the first UPC scan. The NCR cash register rang up 67 cents.^{[7]} The entire shopping cart also had barcoded items in it, but the gum was the first one picked up. This item went on display at the Smithsonian Institution's National Museum of American History in Washington, D.C.^{[8]}
IBM proposal
Around late 1969, IBM at Research Triangle Park (RTP) in North Carolina assigned George Laurer to determine how to make a supermarket scanner and label. In late 1970, Heard Baumeister provided equations to calculate characters per inch achievable by two IBM bar codes, Delta A and Delta B. In February, 1971, Baumeister joined Laurer.
In mid 1971, William "Bill" Crouse invented a new bar code called Delta C.^{[3]} It achieved four times the characters per inch as Delta B. Delta B compared bar widths to space width to code bits. This was extremely sensitive to ink spread where too much ink or pressure would cause both edges of a bar to spread outward and too little to cause them to shrink. To make it worse as bars spread spaces shrink and vice versa. Delta C achieved its higher performance by only using leading to leading or trailing to trailing edges which was unaffected by uniform ink spread. The code provided best performance when it had a defined character set with a fixed reference distance that spanned most or preferably all the character. In August, 1971, Crouse joined the scanner effort. After several months they had made no progress. They were aware of the RCA bull’s eye label that could be scanned with a simple straight line laser scanner, but a readable label was far too large. Although Litton Industries proposed a bull’s eye symbol cut in half to reduce the area, it was still too large and presented the same ink smear printing problems as the RCA symbol. The redundancy and checking ability were removed completely. They were also aware of the many proposals from around the world, none of which were feasible.
In the spring of 1972, Baumeister announced a breakthrough. He proposed a label with bars that were slightly longer than the distance across all bars that needed to be read in a single pass. This label could be scanned with a simple “X” scanner only slightly more complex than the straight line laser scanner. The next day Baumeister suggested if the label were split into two halves the bar lengths could be cut nearly in half. These two proposals reduced the area from the bull’s eye by one third and then one sixth. The image to the right shows the label proposed by Baumeister. He did not specify any specific bar code as that was well understood. Except for the bar coding and ten digits the UPC label today is his proposal. Shortly after that Baumeister transferred to another area of RTP.
Laurer proceeded to define the details of the label and write a proposal. N.J. Woodland was assigned as planner for the project and aided Laurer with writing his proposal.
Laurer’s first attempt with a bar code used Delta B. The resulting label size was about six inches by three inches which was too large. Crouse suggested that Laurer use his Delta C bar code and provided a copy of his patent that had a sample alphanumeric character set and rules to generate other size alphabets. This reduced the label size to about 1.5” x 0.9”. Later Laurer asked Crouse for assistance in how the scanner could detect a label. Together they defined guard bars and a definition of how to detect the label. The guard bars also provided identification for half label discrimination and training bars for the scanner threshold circuits. Laurer had a complete label definition and proceeded to write his proposal.^{[9]}
Previously Crouse had an idea for a simple wand worn like a ring and bracelet. He decided to develop that wand to provide a demonstration of the label.^{[citation needed]}
On December 1, 1972, IBM presented Laurer's proposal to the Super Market Committee in Rochester, Minnesota, the location where IBM would develop the scanner. During the presentation, Crouse gave a lab demonstration where he read UPClike labels with his ring wand. In addition to reading regular labels, he read the large twopage centerfold label in the proposal booklet. He then turned to a page showing a photo of labeled items sitting on a table. The labels were small and flawed due to the resolution of the printed photo but the wand read many of them. This demonstration showed the robustness of the pure Delta C code. The proposal was accepted.
One month later, January 1, 1973 Crouse transferred back to IBM's Advanced Technology group, and Laurer remained with the full responsibility for the label.
Dymo Industries, makers of handheld printing devices insisted that the code be character independent,^{[clarification needed]} so that handheld printing devices could produce the bar code in store if the items were not barcoded by the manufacturers. Dymo's proposal was accepted by IBM and incorporated in IBM's latest proposal.
It was decided that the two halves of the label should have a different set of numeric characters. The character set Laurer derived from the Delta C patent used seven printable increments or units where two bars and two spaces would be printed. This yielded twenty combinations of characters, but there were two pairs that when read by Delta C rules yielded the same code for the pair. Since eighteen characters were not enough Laurer tried adding one unit to the character set. This yielded twentysix Delta C characters which could provide the two sets of decimal characters but it also added fourteen percent to the width of the label and thereby the height. This would be a thirty percent increase in area or a label of 1.7”x1.03”. Laurer felt this was not acceptable. He returned to the original character set with twenty characters but four of those were two pairs with the same Delta C reading. He decided to use them all. To distinguish between the pairs he would measure one bar width in each of the pairs to distinguish them from each other. For each pair those bars would be one or two units wide. Laurer didn’t apply Baumeister’s equations to this set. He felt just one bar width measurement would not be too serious. As it turned out it would have required over fifty percent increase in width and height for an area increase of more than double. Laurer later admitted these four characters in each set were responsible for most of the scanner read errors.
David Savir, a mathematician, was given the task of proving the symbol could be printed and would meet the reliability requirements, and was most likely unaware of Baumeister’s equations. He and Laurer added two more digits to the ten for error correction and detection. Then they decided to add odd/even parity to the number of units filled with bars in each side. Odd/even parity is a technique used to detect any odd number of bit errors in a bit stream. They decided to use odd on one half and even on the other. This would provide additional indication of which half ticket was being read. This meant that every bar width had to be read accurately to provide a good reading. It also meant every space would also be known. Requiring every bit width to be read precisely basically nullified the Delta C advantage except for the Delta C reference measurement. Only the strange character set and the size of the label remains as a shadow of the Delta C code. The size was still that calculated for pure Delta C. If the label size had been properly recalculated, taking into account the required bar width measurements the label would have been far too large to be acceptable.
Mechanical engineering and electronic circuit design commonly require worst case designs using known tolerances. Many engineers working with bar codes had little experience with such things and used somewhat intuitive methods. This was the cause of the poor performance of the Delta B code and quite likely the failure of RCA’s bull’s eye scanner.
The following table shows the workable labels, available in the early 1970s, with their sizes.
Label type  Label dimensions  Area 

Bull’s eye with Morse Code  Large  Large 
Bull’s eye with Delta B  12.0" diameter  113.10 sq. in. 
Bull’s eye with Delta A  9.0" diameter  63.62 sq. in. 
Baumeister 1st w/ Delta B  6.0" × 5.8"  34.80 sq. in. 
Baumeister 2 halves w/ Delta B  6.0" × 3.0"  18.00 sq. in. 
Baumeister 2 halves w/ Delta A  4.5" × 2.3"  10.35 sq. in. 
Baumeister with Delta C  1.5" × 0.9"  1.35 sq. in. 
This is assuming a bull’s eye with the same information and reliable readability.
Composition
Each UPCA barcode consists of a scannable strip of black bars and white spaces above a sequence of 12 numerical digits. No letters, characters or other content of any kind may appear on a UPCA barcode. There is a onetoone correspondence between 12digit number and strip of black bars and white spaces, i.e. there is only one way to represent each 12digit number visually and there is only one way to represent each strip of black bars and white spaces numerically.
The scannable area of every UPCA barcode follows the pattern SLLLLLLMRRRRRRE, where S (start), M (middle), and E (end) guard patterns are represented the same way on every UPCA barcode and the L (left) and R (right) sections collectively represent the 12 numerical digits that make each UPCA unique. The first digit L indicates a particular number system to be used by the following digits. The last digit R is an error detecting check digit, that allows some errors to be detected in scanning or manual entry. The guard patterns separate the two groups of six numerical digits and establish the timing.
UPCA  UPCE 

Note: UPCA 042100005264 is equivalent to UPCE 425261 with the "EOEEOO" parity pattern, which is defined by UPCA number system 0 and UPCA check digit 4.
Formatting
UPCA barcodes can be printed at various densities to accommodate a variety of printing and scanning processes. The significant dimensional parameter is called xdimension (width of single module element). The width of each bar (space) is determined by multiplying the xdimension and the module width (1, 2, 3, or 4 units) of each bar (space). Since the guard patterns each include two bars, and each of the 12 digits of the UPCA barcode consists of two bars and two spaces, all UPCA barcodes consist of exactly (3 × 2) + (12 × 2) = 30 bars, of which 6 represent guard patterns and 24 represent numerical digits.
The xdimension for the UPCA at the nominal size is 0.33 mm (0.013"). Nominal symbol height for UPCA is 25.9 mm (1.02"). The bars forming the S (start), M (middle), and E (end) guard patterns, are extended downwards by 5 times xdimension, with a resulting nominal symbol height of 27.55 mm (1.08"). This also applies to the bars of the first and last numerical digit of UPCA barcode. UPCA can be reduced or magnified anywhere from 80% to 200%.
A quiet zone, with a width of at least 9 times the xdimension, must be present on each side of the scannable area of the UPCA barcode.^{[10]}^{[11]} For a GTIN12 number encoded in a UPCA barcode, the first and last digit are always placed outside the symbol, to indicate the quiet zones, that are necessary for barcode scanners to work properly.
Encoding
The UPCA barcode is visually represented by strips of bars and spaces, that encode the UPCA 12digit number. Each digit is represented by a unique pattern of 2 bars and 2 spaces. The bars and spaces are variable width, i.e. 1, 2, 3, or 4 modules wide. The total width for a digit is always 7 modules, consequently UPCA 12digit number requires a total of 7×12 = 84 modules.
A complete UPCA is 95 modules wide: 84 modules for the digits (L and R sections) combined with 11 modules for the S (start), M (middle), and E (end) guard patterns. The S (start) and E (end) guard patterns are 3 modules wide and use the pattern barspacebar, where each bar and space is one module wide. The M (middle) guard pattern is 5 modules wide and uses the pattern spacebarspacebarspace, where each bar and space is also one module wide. In addition, a UPCA symbol requires a quiet zone (extra space of 9 modules wide) before the S (start) and after the E (end) guard patterns.
Quiet zone 
S (start) 
L (left numerical digit) 
M (middle) 
R (right numerical digit) 
E (end) 
Quiet zone 


0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5  6  7  8  9  
The UPCA's lefthand side digits (the digits to the left of the M (middle) guard pattern) have odd parity, which means the total width of the black bars is an odd number of modules, on the contrary, the righthand side digits have even parity. Consequently, a UPC scanner can determine whether it is scanning a symbol from lefttoright or from righttoleft (the symbol is upsidedown). After seeing a S (start) or E (end) guard pattern (they are the same, barspacebar, whichever direction they are read), the scanner will first see odd parity digits, if scanning lefttoright, or even parity digits, if scanning righttoleft. With the parity/direction information, an upsidedown symbol will not confuse the scanner. When confronted with an upsidedown symbol, the scanner may simply ignore it (many scanners alternate lefttoright and righttoleft scans, so they will read the symbol on a subsequent pass) or recognize the digits and put them in the right order. There is another property in the digit encoding. The righthand side digits are the optical inverse of the lefthand side digits, i.e. black bars are turned into white spaces and vice versa. For example, the lefthand side "4" is space×1  bar×1  space×3  bar×2, meanwhile the righthand side "4" is bar×1  space×1  bar×3  space×2.
Numbering
The number of UPCA and UPCE barcodes are limited by the standards used to create them.
UPCA: (10 possible values per left digit ^ 6 left digits) × (10 possible values per right digit ^ 5 right digits) = 100,000,000,000.
UPCE: (10 possible values per digit ^ 6 digits) × (2 possible parity patterns per UPCE number) = 2,000,000.
Number system digit
Below is description of all possible number systems with corresponding 12digit UPCA numbering schema LLLLLLRRRRRR, where L denotes number system digit and R check digit.
 0, 1, 6, 7, 8, 9:

 For most products. The LLLLL digits are the manufacturer code (assigned by local GS1 organization), and the RRRRR digits are the product code.
 2:

 Reserved for local use (store/warehouse), for items sold by variable weight. Variableweight items, such as meats, fresh fruits, or vegetables, are assigned an item number by the store, if they are packaged there. In this case, the LLLLL is the item number, and the RRRRR is either the weight or the price, with the first R determining which (0 for weight).
 3:

 Drugs by National Drug Code (NDC) number. Pharmaceuticals in the U.S. use the middle 10 digits of the UPC as their NDC number. Though usually only overthecounter drugs are scanned at point of sale, NDCbased UPCs are used on prescription drug packages and surgical products and, in this case, are commonly called UPN Codes.^{[12]}
 4:

 Reserved for local use (store/warehouse), often for loyalty cards or store coupons.
 5:

 Coupons. The LLLLL digits are the manufacturer code, the first 3 RRR are a family code (set by manufacturer), and the next 2 RR are a coupon code, which determines the amount of the discount. These coupons can be doubled or tripled.
Check digit calculation
Formally, UPCA check digit meets the check digit equation:
Generally, in the UPCA system, the check digit is calculated as follows:
 Sum the digits at oddnumbered positions (first, third, fifth,..., eleventh).
 Multiply the result by 3.
 Add the digit sum at evennumbered positions (second, fourth, sixth,..., tenth) to the result.
 Find the result modulo 10 (i.e. the remainder, when divided by 10).
 If the result is not 0, subtract the result from 10.
For example, in a UPCA barcode "03600029145x", where x is the unknown check digit, x can be calculated by:
 Sum the oddnumbered digits (0 + 6 + 0 + 2 + 1 + 5 = 14).
 Multiply the result by 3 (14 × 3 = 42).
 Add the evennumbered digits (42 + (3 + 0 + 0 + 9 + 4) = 58).
 Find the result modulo 10 (58 mod 10 = 8).
 If the result is not 0, subtract the result from 10 (10 − 8 = 2).
Thus, the check digit x is 2.
Note:
 UPCA can detect 100% of single digit errors.

 Proof :

 Consider check digit equation and fact, that , where denotes ring of integers modulo 10.






























 ▯






























 Consider check digit equation and fact, that , where denotes ring of integers modulo 10.

 Proof :
 UPCA can detect 90% of transposition errors. Specifically, if and only if the difference between two adjacent digits is 5, the UPCA can't detect their transposition.

 Proof :

 (1) Considering check digit equation and transposition of adjacent digits of difference , where , we get partial sums:

 and
 .

 Proof :



 Since if and only if , suggests end of proof for second part of the proposition.





 (2) We still have to prove, that UPCA can detect 90% of transposition errors.
 Let's have a look at the Table of dtranspositions for UPCA barcodes, where






Table of dtranspositions for UPCA barcodes dN°0 1 2 3 4 5 6 7 8 9 N°1 0 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 N°2 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 N°3 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 N°4 3 3 3 4 3 5 3 6 3 7 3 8 3 9 N°5 4 4 4 5 4 6 4 7 4 8 4 9 N°6 5 5 5 6 5 7 5 8 5 9 N°7 6 6 6 7 6 8 6 9 N°8 7 7 7 8 7 9 N°9 8 8 8 9 N°10 9 9 Sum 10 18 16 14 12 10 8 6 4 2






 Row Sum contains numbers of dtranspositions, therefore the proportion of nondetectable transposition errors is




























 ▯

























Variations
UPC in its most common usage technically refers to UPCA.
Other variants of the UPC exist:
 UPCB is a 12digit version of UPC with no check digit, developed for the National Drug Code (NDC) and National Health Related Items Code.^{[13]}^{[not in citation given]} It has 11 digits plus a 1digit product code, and is not in common use.^{[14]}
 UPCC is a 12digit code with a product code and a check digit; not in common use.^{[14]}
 UPCD is a variable length code (12 digits or more) with the 12th digit being the check digit. These versions are not in common use.
 UPCE is a 6digit code, that has its equivalent in UPCA 12digit code with number system 0 or 1.
 UPC2 is a 2digit supplement to the UPC used to indicate the edition of a magazine or periodical.
 UPC5 is a 5digit supplement to the UPC used to indicate suggested retail price for books.
As the UPC becomes technologically obsolete, it is expected^{[by whom?]} that UPCB and UPCC will disappear from common use by the 2010s. The UPCD standard may be modified into EAN 2.0 or be phased out entirely.^{[citation needed]}
UPCE
To allow the use of UPC barcodes on smaller packages, where a full 12digit barcode may not fit, a 'zerosuppressed' version of UPC was developed, called UPCE, in which the number system digit, all trailing zeros in the manufacturer code, and all leading zeros in the product code, are suppressed (omitted).^{[15]} This symbology differs from UPCA in that it only uses a 6digit code, does not use M (middle) guard pattern, and the E (end) guard pattern is formed as spacebarspacebarspacebar, i.e. UPCE barcode follows the pattern SDDDDDDE. The way, in which a 6digit UPCE relates to a 12digit UPCA, is determined by UPCE numerical pattern and UPCE parity pattern. It can only correspond to UPCA number system 0 or 1, the value of which, along with the UPCA check digit, determines the UPCE parity pattern of the encoding. With the manufacturer code digits represented by X's, and product code digits by N's, then:
Last UPCE digit  UPCE numerical pattern  UPCA equivalent 

0  XXNNN0  0 or 1 + XX00000NNN + check digit 
1  XXNNN1  0 or 1 + XX10000NNN + check digit 
2  XXNNN2  0 or 1 + XX20000NNN + check digit 
3  XXXNN3  0 or 1 + XXX00000NN + check digit 
4  XXXXN4  0 or 1 + XXXX00000N + check digit 
5  XXXXX5  0 or 1 + XXXXX00005 + check digit 
6  XXXXX6  0 or 1 + XXXXX00006 + check digit 
7  XXXXX7  0 or 1 + XXXXX00007 + check digit 
8  XXXXX8  0 or 1 + XXXXX00008 + check digit 
9  XXXXX9  0 or 1 + XXXXX00009 + check digit 
For example, a UPCE 654321 may correspond to the UPCA 065100004327 or 165100004324, depending on the UPCE parity pattern of the encoded digits, as described next:
UPCA check digit 
UPCE parity pattern for UPCA number system 0 
UPCE parity pattern for UPCA number system 1 

0  EEEOOO  OOOEEE 
1  EEOEOO  OOEOEE 
2  EEOOEO  OOEEOE 
3  EEOOOE  OOEEEO 
4  EOEEOO  OEOOEE 
5  EOOEEO  OEEOOE 
6  EOOOEE  OEEEOO 
7  EOEOEO  OEOEOE 
8  EOEOOE  OEOEEO 
9  EOOEOE  OEEOEO 
UPCE 654321 with "EOEOEO" parity pattern (UPCA 065100004327) would be encoded as
111 4111 1231 2311 1411 2212 2221 111111.
The barcode would look like this:
EAN13
The EAN13 was developed as a superset of UPCA, adding an extra digit to the beginning of every UPCA number. This expanded the number of unique values theoretically possible by ten times to 1 trillion. EAN13 barcodes also indicate the country in which the company that sells the product is based (which may or may not be the same as the country in which the good is manufactured). The three leading digits of the code determine this, according to the GS1 country codes. Every UPCA code can be easily converted to the equivalent EAN13 code by prepending 0 digit to the UPCA code. This does not change the check digit. All pointofsale systems can now understand both equally.
EAN8 is an 8digit variation of the EAN barcode.
UPC usage notes:
 All products, marked with an EAN, will be accepted in North America currently  in addition to those already marked with a UPC.
 Product with an existing UPC does not have to be remarked with an EAN.
 In North America, the EAN adds 30% more codes, mainly by adding digits '10 through 12' to the UPC digits '00 through 09'. This is a powerful incentive to phase out the UPC.
See also
 GS1 – International supplychain standards organization
 Proof of purchase
References
 ^ "GS1 US > RESOURCES > Standards > EAN/UPC visuals". gs1us.org.
 ^ US patent 2612994, Woodland, Norman J. & Bernard Silver, "Classifying Apparatus and Method", issued October 7, 1952
 ^ ^{a} ^{b} "UPC  The Transformation of Retail". Retrieved April 28, 2016.
 ^ "A Brief History of the Bar Code". Esquire. 153 (3): 42. March 2010.
 ^ "Our history  Careers  McKinsey & Company". mckinsey.com.
 ^ Nelson, Benjamin (1997). Punched cards to bar codes : a 200 year journey ; with description and examples of over 270 different machinereadable codes. Peterborough, N.H.: Helmers. ISBN 9780911261127.
 ^ Alfred, Randy, "June 26, 1974: By Gum! There's a New Way to Buy Gum" Archived August 24, 2010, at the Wayback Machine. Wired magazine 06.26.08
 ^ Scanning Species, Harvard Magazine, September  October 2005
 ^ "Alumni Hall Of Fame Members". University of Maryland Alumni Association. The University of Maryland. 2005. Archived from the original on 20070623. Retrieved 20090610.
After graduating from Maryland in 1951, George Laurer joined IBM as a junior engineer and worked up the ranks to senior engineer. In 1969, he returned to the technical side of engineering and was later assigned the monumental task of designing a code and symbol for product identification for the Uniform Grocery Product Code Council. His solution—the Universal Product Code—radically changed the retail world. Since then, he has enhanced the code by adding a 13th digit.
 ^ rainman_63 (6 April 2005). "Drawing UPCA Barcodes with C#". codeproject.com.
 ^ "UPC Symbol Specification Manual".
 ^ "Barcodes for Pharmaceuticals and Surgical Products".
 ^ "NHRIC (National Health Related Items Code)". HealthData. U.S. Department of Health & Human Services.
 ^ ^{a} ^{b} http://www.adams1.com/upccode.html
 ^ "UPCE Symbology". Retrieved 21 January 2013.
Further reading
 US 3832686, Bilgutay, Ilhan M., "Bar Code Font", published May 11, 1972, issued August 27, 1974
 US 3145291, Brainerd, H. B., "Identification System", published July 2, 1959, issued April 18, 1964 Railroad bar code.
 US 3617707, Shields, Charles B. & Roelif Stapelfeldt, "Automatic car identification system", published August 17, 1967, issued November 2, 1971
 US 3723710, Crouse, William G. & John E. Jones, "Method and Device for Reading and Decoding a High Density SelfClocking Bar Code", published June 28, 1971, issued March 27, 1973
External links
 History of identification codes
 UPCSearch.org Free online database of UPCs