Global Trade Item Number.

Four lengths, one 14-digit identity; GS1 mod-10; symbology bindings; license-clean enrichment rails.

The barcode on the shelf, blown out.

4 the printed thirteenth printed, but encoded in NO bars — it lives in the L/G parity pattern of the left six digits
006381 left six each digit wears L or G parity; that pattern IS the thirteenth digit
33393 item digits company prefix + item — the prefix length varies (GS1 assigns it), so the split comes from the pinned prefix table
1 check this digit exists only to certify the others — mod10 pass
EAN-13  400638133393 · check 1
sum     4×1 + 0×3 + 0×1 + 6×3 + 3×1 + 8×3 + 1×1 + 3×3 + 3×1 + 3×3 + 9×1 + 3×3 = 89
check   (10  89 mod 10) mod 10 = 1   → mod10 pass

The row.

schemegs1.gtin
grammar8, 12, 13 or 14 digits (GTIN-8/12/13/14); the final digit is the check digit. Four lengths, one identity: canonicalization zero-pads to the 14-digit form.
check digitGS1 GenSpecs mod-10, right-anchored — alternating 3/1 weights from the rightmost data digit; the check digit makes the weighted sum a multiple of ten.
canonical formThe 14-digit zero-padded form. GTIN + serial derives urn:epc:id:sgtin; GTIN + lot derives urn:epc:class:lgtin.
symbologiesUPC-A · EAN-8 · EAN-13 · ITF-14 · GS1-128 (AI 01) · GS1 DataMatrix / QR via element string or Digital Link URI
enrichmentfood: USDA FoodData Central (CC0, public-domain) · Open Facts family (ODbL, segregated share-alike layer)
join ruleepcList (serialized) or quantityList (lot/class grain) of an EPCIS 2.0 ObjectEvent — the AI map decides the grain.
pinned digestgs1.gtin sha256:e426d368687d9a244454dc4198fcb210ce9aaa134603fa99fb5ae4fb9ebc9cd6
as data/schemes/gtin.json

In practice.

Two schemes live inside the GTIN space and are detected by declared precedence, not guesswork: an ISBN is a valid GTIN-13 in the 978/979 prefix, and a US drug GTIN carries an NDC behind the “3”-prefixed UPC. The registry states the precedence; resolve applies it and says which reading it chose.

Prefix legitimacy is part of verify, not an extra call: GS1 prefix ranges map to the issuing MO from pinned tables, so a structurally valid number with an unissued prefix is a typed verdict, not a pass.

On the blog.

  • GTIN: the four lengths, one identity

    GTIN-8, -12, -13 and -14 are one identifier at four encodings. Canonical form is the zero-padded GTIN-14, the check digit is one public mod-10 algorithm anchored at the right, and most of what your bug tracker files as invalid barcode is actually a canonicalization bug.

  • The 1D UPC is a checkout token — the brand learns nothing from its own barcode

    A UPC is scanned millions of times by other people's point-of-sale systems, and the stripes' owner is the only party they carry no signal for. The information budget of 12 digits versus a decoded 2D payload, computed — and the honest sentence about what nobody can promise you yet.

  • An ISBN is a GTIN: what Bookland means for a universal resolver

    ISBN-13 is a valid GTIN-13 under the 978/979 prefixes, which means a universal resolver needs no "books mode" — it needs prefix routing. The ISBN row is the cleanest demonstration that scheme detection is a table, not a heuristic, and its enrichment column is the cleanest demonstration of what honest license posture looks like.

  • NDC: the identifier with no check digit, and what validation means without one

    The National Drug Code is ten digits in three segments and carries no check digit at all — so "valid" can only ever mean structurally parseable plus present in the registry. The NDC is the scheme that forces a resolver to be honest about validation tiers, and the honesty generalizes.

  • bridge: from SKU to GTIN candidates, with the evidence attached

    For the systems that carry no GTIN at all — small-business accounting, restaurant POS, parcel labels — candidate GTIN resolution with confidence and evidence, never a silent best guess, is the entire product. The bridge contract, the evidence object, and why exit code 1 is a feature.

Get an API key.

The local verbs run from npx barcoding.dev today with no key. A key opens the network half of the verb set.