

UPC Barcode Introduction

An Introduction to UPC Barcodes UPC Barcodes

Because of its use in retail products, the UPC Barocode or Universal Product Code is the most widely used and recognized of all barcode symbologies. The UPC Barcode was designed to identify a product's manufacturer and unique product number. Our UPC barcode font documentation and samples are specifically tailored to address encoding the UPC A or UPC Version A code. However, with a little work on your part, you can encode other UPC versions or UPC E.  Contact us if you want us to walk you through the steps for encoding other than UPC version A. Its really easy.

From the original specification UPC A code is a 12-digit number (numeric only) broken into the following components in order:

  • A single-digit number system assignment

  • A 5-digit manufacturer number

  • 5 digit product number.

  • A modulo-10 check digit.  This number is then converted into a barcode using the UPC encoding standard.  

Note that although the original specification dedicated 5 digits to the manufacturer number, recent changes to the specifications allow manufacturer numbers to be up to 9 digits long, and the product number to be 1 to 5 digits long. The total length of the UPC A Code is always 12 digits, with the first digit being the number system assignment and the last one being a check digit. Remember that UPC codes are numeric only.

Lets look at an example. On my desk is a product with the following UPC code - 644209420957. Using the map from above, we can break down the UPC code into the following components:

                    6 - Number System Assignment

            44209 - Manufacturer Code

            42095 - Item Code

                    7 - Check Digit

If you go to and type in the number, you can see what I have on my desk. I'll give you a hint, the "D" in "DK" stands for Duncan. Check it out, its fun.

UPC Barcode Guard Bars

When encoding a UPC A barcode, the UPC number is divided into halves, with 6-digits in each half. These digits are surrounded by 2 "guard bars", so there are 2 guard bars at the beginning and the end of each 6-digiUPC Barcode Componentst half.  So, when the code is assembled as a whole, there are 2 guard bars at the beginning of the barcode, 2 in the middle (called "center guards" and 2 guard bars at the end.

UPC Barcode Bar and Space Encoding

The bar and space encoding for each digit consists of 2 bars and 2 spaces within 7 total encoding positions, with the bar or space occupying 1 to 4 of the encoding positions. The UPC barcode is a "mirror" symbology, split in the middle. This means, for example,  that if a 6 on the left side of the code is encoded in the sequence of "space, bar, space, bar", a 6 on the right side is encoded as the mirror image or "bar, space, bar, space". This mirroring combined with the check digit make encoding UPC codes using a barcode font more difficult than a non-mirror code such as code 39.

Here is how a UPC A barcode would look, with labels defining the component of the barcode. In the "human readable" below the bars, the number system digit is the "6" and the check digit is the "7":(note the mirroring of the 4 and the 0)

Why a Check Digit, and How to compute it

The last digit in the UPC code is a modulo 10 check digit. The purpose of a check digit is to verify that the scanner reads the code correctly. The barcode reader's decoder calculates the check digit by performing a series of mathematical operations on the digits that precede it. If the scanner calculated check digit and the check digit in the barcode match, the scanner concludes that it has read the barcode correctly and sends the data.

Basically, calculating the check digit requires doing mathematics on the digits so that you yield a final number that reasonably verifies that you saw all the prior digits. All scanners are capable of doing this math automatically. Since you might have to do the math yourself (or include calculations in a program or macro), this is how you calculate the UPC check digit using the sample above:

  • Add the digits in the odd numbered positions of the UPC code, and multiply the total by 3
    (In the example, this would be 6 + 4 + 0 + 4 + 0 + 5 = 19 x 3 = 57)

  • Add the digits in the even numbered positions of the UPC code
    (In the example, this would be 4 + 2 + 9 + 2 + 9  = 26)

  • Add the results of the first 2 steps together
    (57 + 26 = 83)

  • Since the check digit is a modulo 10, compute what single digit number makes the total a multiple of 10?
    (83 + 7 = 90) So the check digit is 7!

We provide a couple of tools for the check digit calculation:

  • Excel Worksheet that gives you the check digit with code to transfer to your project.

  • Excel Worksheet that gives you the characters to type on your keyboard, including the check digit.