UPC/EAN (Universal Product Code / European Article Numbering) is probably the most widespread barcoding system. EAN codes (8 and 13 digit) are used in all European countries, while UPC ones (8 and 12 digit) are more frequent in the North America. The encoding scheme for both barcode types is the same (12-digit UPC is a subset of 13-digit EAN). These barcodes can carry numeric information only.

The generator supports EAN-13, EAN-8, UPC-A, and UPC-E barcodes, including checksum generation. Type of the generated barcode is deduced from the input data, or specified explicitly as a parameter to the stylesheet.

XSLT stylesheets: upc-ean.xsl upc-ean-svg.xsl
Sample: testdata.xml test-barcodes-fo.xsl testdata.pdf
Online demo:

Enter exactly 6, 7, 11 or 12 digits in the field above, and press the button.


Do not include the check digit (the last digit on barcode labels) — it will be calculated by the generator.

The generated barcode type depends on the data length:

  • 6 digits get coded as UPC-E (with leading zero prepended);

  • 7 digits as EAN-8;

  • 11 digits as UPC-A;

  • 12 digits as EAN-13.