EAN-13 and UPC Validator
Check the check digit of a 13-digit EAN or 12-digit UPC product code.
How this tool works
The EAN 13 is a 13 digit barcode number, and its last digit is a check digit computed by a weighted sum modulo 10. It is the same checksum family as the UPC, the ISBN 13 and the GTIN, and the same routine validates all of them.
The validation is short. The number must be 13 digits, and the weighted sum of the first twelve digits, alternating 1 and 3 from the left, must leave a remainder that the thirteenth digit completes to a multiple of 10. Because the weights alternate, a transposed pair of adjacent digits is always caught, which is the whole point of the scheme on a barcode that is scanned rather than keyed.
Worked example
| Step | Value |
|---|---|
| Number | 4006381333931 |
| Weighted sum of the first 12 digits | 95 |
| Check digit | 5 |
| Result | Valid, 95 + 5 = 100, a multiple of 10 |
The first digit indicates the GS1 prefix range, so 0 to 3 are in-store or restricted, 4 to 5 are for use inside a store, 6 is a country code, 7 to 9 are international, and 978 and 979 are for ISBNs.
When to use it
- Check a barcode number typed into a form
- Validate product codes in a catalogue import
- Confirm a GTIN before sending it to a retailer
- Verify that a barcode number was transcribed correctly
Frequently asked questions
What is an EAN 13?
A 13 digit barcode number defined by GS1, used to identify a trade item. Its last digit is a check digit computed by a weighted sum modulo 10.
How is the EAN 13 check digit computed?
Multiply the first twelve digits alternately by 1 and 3 starting from the left, sum them, and take the remainder modulo 10. The check digit is what brings the total to a multiple of 10.
What do the leading digits mean?
They are the GS1 prefix. 0 to 3 are for in-store or restricted use, 4 and 5 for use within a store, 6 identifies a GS1 country, 7 to 9 are international, and 978 and 979 are reserved for ISBNs.
Does a valid EAN mean the product is genuine?
No. It means the number is internally consistent. A counterfeit product can carry a perfectly valid number, which is why retailers check the number against their own database rather than against the checksum.
Is an EAN 13 the same as a UPC?
A UPC is a 12 digit EAN with a leading zero, and the two share the same checksum family.
Can a valid EAN 13 be unallocated?
Yes. The checksum does not check whether the number has been issued, only that it was not mistyped.