A broker keys an air waybill as 176-66977401. The real number is 176-66977400. Everything else on the entry is right: tariff lines, valuation, duty. The entry fails anyway, because the waybill on the declaration matches nothing in the carrier's or the port's records. Release waits on an amendment, and the cargo sits in a shed accruing storage.

The error was detectable before anything was sent, with arithmetic a clerk could do on a calculator. The last digit of an air waybill serial is a check digit, and 6697740 divided by 7 leaves 0, not 1.

The air waybill is not special. Most identifiers that move through a supply chain carry a built-in test: containers, barcodes and pallet labels, ships, customs reference numbers, bank accounts, vehicles. This article walks through the ones that matter in trade, how each is calculated, what each catches, and where the check stops being useful.

Why identifiers carry their own check

Trade identifiers were designed for a world of paper and re-keying. A waybill number was printed on pre-numbered stock, then written or typed again by the agent, the airline's cargo office, the transfer carrier, the broker and the handler at destination. Every re-keying was a fresh chance to mistype a digit or swap two.

A check digit is one extra character calculated from the others. Any system can recompute it on the spot without a database lookup, so the typo surfaces at the keyboard rather than days later as a rejected entry, a misrouted invoice or a container nobody can find.

The schemes differ in strength. The better ones catch virtually every single-character error and every swap of two adjacent characters. The weaker ones catch most. None of them can tell you that a well-formed number is the right number for this shipment. More on that limit at the end.

The catalogue

Identifier Where you meet it Check Standard
Air waybill Air cargo, customs entries Serial mod 7 IATA
Container number Sea and intermodal, B/L, declarations Weighted sum mod 11 ISO 6346
GTIN, SSCC, GLN Product barcodes, pallet labels, party IDs Alternating 3/1 weights, mod 10 GS1
IMO ship number Vessel identity, sanctions screening Weights 7 down to 2, mod 10 IMO
EU and UK MRN Export, transit and import declarations 18th character, ISO 6346 method Customs data model
IBAN Payments, letters of credit Mod 97 ISO 13616
LEI Counterparties, trade finance, reporting Mod 97 ISO 17442
VIN Vehicle exports Weighted sum mod 11, ninth character North American rule

Air waybill: mod 7

An air waybill number is a three-digit airline prefix (176 is Emirates, 125 British Airways, 083 South African Airways) followed by an eight-digit serial. The prefix plays no part in the check. Take the first seven digits of the serial as one number, divide by 7, and the remainder must equal the eighth digit.

For 176-66977400: 6697740 รท 7 = 956,820 exactly, remainder 0. The last digit is 0, so the number is well formed.

Two consequences follow. A remainder can only be 0 to 6, so a serial ending in 7, 8 or 9 is invalid on sight. And mod 7 is a weak scheme. Any digit changed by exactly 7 (a 0 keyed as a 7, a 1 as an 8, a 2 as a 9) passes the check in every position, because 7, 70, 700 and so on are all divisible by 7. Keying 66977400 as 66277400, the 9 keyed as a 2, goes through clean. Mod 7 catches most errors, not all of them.

Container number: ISO 6346

A container number has four parts. Take CSQU3054383:

Letters become numbers starting at A = 10 and skipping every multiple of 11, so A = 10, B = 12, K = 21, L = 23, up to Z = 38. Each of the first ten characters is then multiplied by 2 raised to its position: 1, 2, 4, 8 and so on up to 512.

C S Q U 3 0 5 4 3 8
Value 13 30 28 32 3 0 5 4 3 8
Weight 1 2 4 8 16 32 64 128 256 512
Product 13 60 112 256 48 0 320 512 768 4,096

The products sum to 6,185. Divide by 11 and the remainder is 3, which is the check digit. A remainder of 10 would be written as 0, which is why owners are advised not to issue serials that produce it.

It is a strong scheme. It catches every single wrong digit in the serial and almost every adjacent transposition. It has two blind spots: serials whose remainder is 10, and owner-code letters whose values differ by 11, such as A and K or B and L, which the check cannot tell apart. That matters, because container numbers are read off steel by tired people and by OCR cameras at gates, and both confuse O with 0 and I with 1. A wrong container number on a declaration or bill of lading leaves the box unmatched in the terminal system.

GTIN, SSCC and GLN: GS1 mod 10

Every barcode on a retail product (EAN-13, UPC-A, GTIN-14), every SSCC on a pallet label and every GLN identifying a location or a party uses the same GS1 algorithm. Working from the right-hand end of the number, excluding the check digit, multiply digits alternately by 3 and 1, sum the results, and the check digit is whatever brings the total up to the next multiple of 10.

For the EAN-13 4006381333931, the weighted sum of the first twelve digits is 89. The next multiple of 10 is 90, so the check digit is 1.

GS1 mod 10 has one known gap: it misses a swap of adjacent digits that differ by 5, such as 27 keyed as 72.

In a trade context the SSCC is the one to watch. It is the 18-digit number on a logistics label that links a physical pallet to its despatch advice, and a mis-keyed SSCC breaks the match between what arrived and what was declared to arrive.

IMO ship number

A vessel's IMO number stays with the hull for life, through renaming, reflagging and changes of owner. That is why sanctions screening keys on it rather than on the vessel's name. It is seven digits. Multiply the first six by 7, 6, 5, 4, 3 and 2, sum them, and the last digit of the total is the check digit.

For IMO 9074729: 9ร—7 + 0ร—6 + 7ร—5 + 4ร—4 + 7ร—3 + 2ร—2 = 139. The last digit is 9, and so is the seventh digit of the number.

A screening process that matches on IMO number but accepts a mistyped one will screen the wrong ship, or no ship at all, and report a clean result.

EU and UK customs reference numbers (MRN)

The 18-character Movement Reference Number that identifies an export, transit or import declaration ends in a check character. The structure is two digits for the year, two letters for the country, thirteen characters identifying the movement (including a procedure indicator), and the check. The calculation is the ISO 6346 container method, applied to the first seventeen characters.

We tested this against 351 sample MRNs taken from HMRC's published CDS test scenarios and our own test files. 314 pass the ISO 6346 check. The 37 that fail are visibly invented placeholders, such as a reference containing CDS123456789. Every structurally genuine MRN in the sample passes.

The practical point is for anyone keying a previous-document reference, discharging transit, or quoting an export MRN as evidence of exit for zero-rating VAT. All of those can be validated at the point of entry.

IBAN and LEI: mod 97

Two finance identifiers turn up in trade documents. The IBAN appears on commercial invoices and in letter-of-credit instructions, and the LEI identifies counterparties in trade finance and regulatory reporting. Both use the ISO 7064 mod 97 method.

For an IBAN, move the first four characters (country code and check digits) to the end, convert letters to numbers (A = 10 to Z = 35), and the resulting number divided by 97 must leave a remainder of 1. GB82WEST12345698765432 passes; change the last digit to a 3 and it fails. An LEI is checked the same way across all twenty characters, with the last two being the check digits.

Mod 97 is the strongest scheme on this list. Two check digits catch essentially every single error and transposition. A payment instruction that fails it should never reach a bank, and a remittance on an IBAN that has been "corrected" by email deserves a second look regardless of what the check says.

VIN: present in some markets, absent in others

A 17-character vehicle identification number carries a check digit in its ninth position. Characters are transliterated to numbers, weighted, summed, and the remainder after dividing by 11 is the check, with 10 written as X. 1M8GDM9AXKP042788 passes, with X in position nine.

The catch is that the check digit is mandatory for vehicles built for North America and China, and optional elsewhere. Many European manufacturers do not use it. A system that rejects any VIN failing the check will reject valid European vehicles. Flag the failure for review instead of blocking it.

Identifiers with no check digit

Several identifiers that brokers and forwarders key every day carry no check at all. They need a different kind of validation.

What a check digit cannot tell you

A check digit proves that a number is internally consistent. It does not prove the number exists, that it belongs to this consignment, or that the person typing it copied it from the right document. 176-66977400 and 176-66977411 are both well-formed waybills. Only one of them is on the aircraft.

That is why a check digit is the first layer of validation, not the only one. In practice there are four:

  1. Format. Length, character set, structure. CSQU3054383 has three letters, a category letter and seven digits.
  2. Check digit. Where one exists, recompute it.
  3. Reference. Does the code exist in the authoritative list on this date: the tariff, the office list, the EORI register, the carrier's own system.
  4. Consistency across documents. The waybill on the invoice matches the waybill on the manifest. The container on the bill of lading matches the declaration. Gross weight is not less than net.

Each layer catches errors the one before it cannot. The first two run in milliseconds with no network call, which makes them cheap enough to apply to every field on every entry.

Where the check belongs

The value of a check digit is that it runs at the moment of capture, when the person who typed the number still has the source document in front of them. Run it at submission instead and the error is found by someone else, later, with the document filed away.

That leads to three design choices.

None of this is new technology. Most of these checks were designed so that a clerk with a pencil could run them. The cost of not running them is a held consignment or a payment to the wrong account, each of which takes far longer to unwind than the second it takes to recompute one digit.