EAN-13 (European Article Number) check digit for retail product barcodes. 13-digit identifier (12 data + 1 check) using alternating weights 1,3 from left. Most widely used barcode standard worldwide, found on virtually all retail products globally.
| Property | Value |
|---|---|
| Category | Checksums |
| Sub-category | Product Barcode |
| Security status | 🎓 Educational Only |
| Complexity | Beginner |
| Inventor | GS1 (formerly EAN International) |
| Year | 1976 |
| Origin | Not specified |
| Source | algorithms/checksum/ean13-checksum.js |
Status: 🎓 Educational Only
No vulnerabilities are recorded for this implementation.
3 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 — Standard EAN-13
| Field | Value |
|---|---|
input |
353930313233343132333435 |
expected |
07 |
Vector 2 — Product barcode
Source: EAN-13 validation
| Field | Value |
|---|---|
input |
343030363338313333333933 |
expected |
01 |
Vector 3 — Simple test
Source: EAN-13 check
| Field | Value |
|---|---|
input |
313233343536373839303132 |
expected |
08 |