Global Trade Item Numbers (GTINs) are in many ways similar to IP addresses, they are everywhere but rarely understood, they also share other properties:
- They are supposedly unique
- They are allocated by one organisation using a hierarchical, country based structure
- There are a few ranges of numbers that have special meanings
The wikipedia entry on GTIN gives a reasonable overview: a 13 or 14 digit long number with a checksum in the last number and with prefixes allocated to various countries, which in turn hand out number blocks to various manufacturers.
So for instance the box of earl grey tea in my kitchen has code 070177086671, you can see the barcode on the right side of the box in the picture. The final 1 in the number is a check digit computed by combining the other numbers. The number is allocated in the US country block (060 – 139), and according to the GS1 database the block starting with prefix 0070177 is allocated to
R. Twining and Company Limited
South Way Andover
SP10 5AQ Hampshire
According to the box, the tea has been blended and packed in Poland, where the actual tea comes from is, of course, a mystery.
Things get interesting when one looks into the special ranges. The most well known GTIN special prefixes are probably the bookland prefixes: 978, 979, those are used to map 10 digit ISBN numbers into GTIN, this is done by removing the ISBN 11-based check number (the last number or letter X) add 978 and compute the GTIN check number and add it to the end. This is why, nowadays, many books sport two ISBN: one 10 digit long one and one 13 digit long one. Within the ISBN itself, there is again a region prefix, which contains editor prefixes. So for instance my old Hitch Hiker’s Guide to the Galaxy has ISBN 0-330-25864-8, and GTIN 9-780330-258647. So we have bookland (978) language area: english speaking (0) publisher: Pan Books (330) and the actual book identifier (25864).
Another special case is the 03 prefix, which maps the US National Drug Code (NDC) into GTIN. The following 9 numbers are NDC drug code. Here again, there is a manufacturer prefix, followed by a product identifier, but also some numbers used to distinguish the same drug, in different quantities. Note that various countries have similar mappings, for instance, swiss drugs will have a code with the 76 (Switzerland) 80 (drugs) followed by the swissmedic drug code (5 digits) and packaging size (3 digits).
Another special range is the common currency coupon range (981-983), this contains not real product, but reduction coupons. Prefix 982 is for reductions in 1¢ increments, from 1¢ to 9.99€, Prefix 981 is for reductions in 10¢ increments, from 10¢ to 99.9€. The prefix is once again followed by an issuer number (4 digits), followed by an coupon number (2 digits), followed by the value of the coupon (3 digits), where the value 0 means the object is free.
Yet Another special range is the one with prefix 2, this is called the GS1 restricted circulation number within a geographic region, basically those are numbers that are only valid locally, typically one organisation, so for instance the pack of leek I bought at Coop has the code 2131183003156. This code is not valid globally, in the same way that the ip address 192.168.1.13 is not valid globally. Prefixes 02 and 04 have similar semantics.