EAN-8 (European Article Number) check digit for compact product barcodes. 8-digit identifier (7 data + 1 check) using alternating weights 3,1 from right. Subset of GTIN family for small products like cigarettes, cosmetics, chewing gum where space is limited.
| Property | Value |
|---|---|
| Category | Checksums |
| Sub-category | Product Barcode |
| Security status | 🎓 Educational Only |
| Complexity | Beginner |
| Inventor | GS1 (formerly EAN International) |
| Year | 1977 |
| Origin | Not specified |
| Source | algorithms/checksum/ean8-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-8
| Field | Value |
|---|---|
input |
39363338353037 |
expected |
04 |
Vector 2 — EAN-8 product
Source: EAN-8 validation
| Field | Value |
|---|---|
input |
32303132333435 |
expected |
01 |
Vector 3 — Simple test
Source: EAN-8 check
| Field | Value |
|---|---|
input |
31323334353637 |
expected |
00 |