This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device.

Azalea Software - barcode 
software

a photo blog

UPC check digit calculator


Figuring out a UPC check digit

UPC check digit calculator

While a UPC barcode may look like it represents a 12-digit number, it's really an 11-digit number with a check digit. The right-most number in the lower right corner is a check digit based on the previous 11 digits. A UPC check digit calculator is needed to figure it out what it should be.

The first 11 digits in a UPC bar code are a combination of one's company prefix and product number. The UPC check digit is calculated and appended to the end. The check digit helps insure that a barcode was created correctly and scanned without error.

To calculate what a UPC code's check digit should be, add up the odd digits, multiple the subtotal by three, add that to the sum of the even digits, and then figure out what single digit number raises it to the next multiple of ten. It's probably easier to illustrate than to explain.

Azalea Software's company prefix assigned by GS1 is "692771". This means we can use any 5 digit number from "00000" to "99999" for our individual barcodes. For our example I'm going to use my childhood ZIP code, "44120".

For a UPC bar code of "69277144120":
  (6 + 2 + 7 + 4 + 1 + 0) = 20
  20 x 3 = 60
  9 + 7 + 1 + 4 + 2 = 23
  60 + 23 = 83
  83 + 7 = 90, the next multiple of 10

Here's how to calculate the UPC check digit in Visual Basic for Applications:
' UPC check digit in VBA, assuming UPCnumber is 11-digit number stored as a string
Subtotal = (Value(Left(UPCnumber, 1)) + (Value(Mid(UPCnumber, 3, 1))) + (Value(Mid(UPCnumber, 5, 1))) + (Value(Mid(UPCnumber, 7, 1))) + (Value(Mid(UPCnumber, 9, 1))) + (Value(Right(UPCnumber, 1)))
Subtotal = (3 * Subtotal) + (Value(Mid(UPCnumber, 2, 1))) + (Value(Mid(UPCnumber, 4, 1))) + (Value(Mid(UPCnumber, 6, 1))) + (Value(Mid(UPCnumber, 8, 1))) + (Value(Mid(UPCnumber, 10, 1)))
checkdigit = Right(Str(300 - Subtotal), 1)

buy UPC barcode software and UPC bar code fontsAt some point you may need to print a UPC barcode. May I suggest UPCTools. UPCTools is a set of UPC barcode fonts for Windows & the Macintosh which comes with a library of sample code to calculate the UPC check digit for you.