UPC-A and EAN-13 barcodes

UPC-A is a subset of EAN-13. Although UPC-A was originally designed to encode 12 digits and EAN-13 to encode 13, both formats effectively encode 13 digits, and nowadays share a common "EAN/UPC" definition.

General format

The actual standards are complex, but the 13 digits represented by EAN/UPC can be thought of in this simplified way:

  • a 1-digit region code (0 or omitted for North America)
  • a 5-digit company prefix (assigned by GS1 to identify the manufacturer)
  • a 6-digit article number (assigned by the manufacturer to identify the item)
  • a 1-digit check character (a digit calculated from the others)

For the main 12 digits (the ones after the optional region code), each digit is directly represented by two pairs of bars and spaces of variable width. The choice of bar/space patterns used for encoding the first six digits imply the region code, which for UPC-A must always be 0 to indicate North America. A pair of extra-long guard bars always appears in the middle and on each end of the barcode.

A human-readable interpretation (HRI) version of the barcode is often printed below the bars, sometimes with the first and/or last digit separately to one side.

Distinguishing UPC-A from EAN-13

UPC-A and EAN-13 differ on how the HRI text is presented:

  • EAN-13 normally shows 13 digits, all on the same line, with the region code to the left of the first set of guard bars, then two groups of six digits in between the other guard bars.
  • UPC-A normally shows 10, 11, or 12 digits, with two groups of five between the guard bars, and with the first and last digits (if present) smaller and respectively positioned high and to the left and right of the outer guard bars. Also, in UPC-A, the bars representing the first and last digits of the encoded string are extended to be the same length as the guard bars.
  • The HRI text of EAN-13 may have a ">" suffix or "T" prefix to indicate directionality or number of digits. The HRI text of any barcode may have dashes to match the catalog number or simplify manual entry; this is especially common on UPC-A. None of these extra characters are encoded in the bars; they are just for the benefit of humans, and they do not reliably indicate the type of barcode.

A barcode reader only sees the pattern of black and white bars. It does not read the HRI, and it does not check the length of the bars. Therefore, the scanner does not know whether it is reading UPC-A or EAN-13, unless it finds that the first six digits in the bars use one of the patterns that implies a non-zero region code. Either way, it initially interprets UPC-A and EAN-13 as a 13-digit string. If the first digit is zero, then depending on how the reader is configured, it may report the string as an EAN-13 with all 13 digits, or it may drop the initial zero and report the string as a 12-digit UPC-A. Free barcode-reading apps for smartphones and tablets often just report everything as EAN-13.

In other words, when the first digit is zero, a barcode reader cannot be trusted to correctly identify the type of barcode; it could be UPC-A or EAN-13.

On Discogs, it is standard to not to mention the type of barcode at all when it is UPC-A or EAN-13 (unless both types are on the same release). If you do wish to add the type of barcode, do not just rely on the barcode reader; use your eyes to confirm the way the human-readable text is printed.

Mythbusting

  • There is no central registry of barcodes.
  • Errors are sometimes made when printing barcodes on items. The barcode may be unscannable, may scan incorrectly, or may belong to a different item. This may be an accident, or on bootlegs it is usually intentional.
  • Sometimes the HRI does not match what is in the bars. Never transcribe the text and then describe it as "Scanned"; it is only scanned if the bars were read and decoded by a machine.

References