Uniform Product Code Check Digit

UPC is a FORTRAN90 library which can compute the check digit associated with a uniform product code (UPC), or it can report whether a 12-digit UPC is actually valid.


The computer code and data files made available on this web page are distributed under the GNU LGPL license.


UPC is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version and a Python version.

Related Data and Programs:

ISBN, a FORTRAN90 library which can determine the check digit for an International Standard Book Number or report whether a given ISBN is valid.

LUHN, a FORTRAN90 program which computes the Luhn check digit for a string, and can validate a string.


  1. David Savir, George Laurer,
    The Characteristics and Decodability of the Universal Product Code,
    IBM Systems Journal,
    Volume 14, Number 1, pages 16-34, 1975.

Source Code:

Examples and Tests:

List of Routines:

You can go up one level to the FORTRAN90 source codes.

Last revised on 08 September 2015.