Hawkynt

UPC-A

UPC-A (Universal Product Code) check digit for North American retail products. 12-digit identifier (11 data + 1 check) using alternating weights 3,1 from right. Developed by IBM in 1973, first scanned in 1974 on Wrigley’s gum. Standard barcode in USA and Canada.

Properties

Property Value
Category Checksums
Sub-category Product Barcode
Security status 🎓 Educational Only
Complexity Beginner
Inventor George Laurer (IBM)
Year 1973
Origin 🇺🇸 United States
Source algorithms/checksum/upca-checksum.js

Security

Status: 🎓 Educational Only

No vulnerabilities are recorded for this implementation.

Notes

Documentation

References

Test vectors

3 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.

Vector 1 — Coca-Cola Classic UPC

Field Value
input 3033363030303239313435
expected 02

Vector 2 — Coke 12oz Can UPC

Field Value
input 3031323030303138313738
expected 08

Vector 3 — Campbell’s Soup UPC

Field Value
input 3035313030303031323233
expected 04

← All algorithms