Air Waybill Verification: The IATA Modulo 7 Check Digit
One digit in an AWB serial number gets misread. Sometimes the check digit catches it instantly. Sometimes, mathematically, it cannot. Here is why.

Table of contents
A cargo agent in Frankfurt keys a Lufthansa air waybill number into a tracking system: 020-58717481. The serial portion, 5871748, was pulled by OCR from a scanned house manifest. Somewhere in that scan, the digit 1 in the thousands position got misread as an 8, so the system actually has 5878748 sitting in its database instead of the real number. Run the check digit math on the corrupted version anyway, and it still comes out to 1, the exact same check digit printed on the document. The verification step passes. Nothing flags. The wrong AWB number sails into the system looking completely legitimate, and it will keep looking legitimate until someone tries to use it to track a shipment that does not exist under that number.
That is not a hypothetical edge case invented to make a point. It is a direct, provable consequence of how the IATA check digit is calculated, and it is exactly the kind of thing that gets glossed over in most explanations of air waybill numbering, which stop at "here is the formula, here is one example, it works." It mostly works. Understanding the specific case where it does not is what separates a document pipeline that treats check digit validation as a real fraud and error control from one that treats it as a box to tick. This post covers the actual IATA-standardized AWB numbering structure, walks the modulo 7 algorithm on real published numbers, and then goes into the part most guides skip: what the check digit is mathematically incapable of catching, and what that means for anyone building or evaluating a shipping document processing pipeline that touches air cargo.
What an IATA air waybill number actually contains
Every air waybill, whether it is a Master Air Waybill issued by the carrier or a House Air Waybill issued by a freight forwarder, carries an 11-digit identifying number. The format is governed by IATA Resolution 600a, the same resolution that standardizes the layout and content of the air waybill document itself. Section 2.1.3.1 of that resolution specifies that the number consists of the issuing carrier's three-digit airline code number followed by a serial number of eight digits, with the final digit of that eight-digit block being a check digit. Section 2.1.3.2 specifies that the check digit is determined using what IATA calls the unweighted Modulus 7 system. Section 5.1.2 repeats the same structural requirement for the pre-printed number that appears on the physical waybill itself, and section 5.1.1 requires that number to appear in three separate places on every copy: upper left corner, upper right corner, and lower right corner, specifically so a check on any single copy can be cross-referenced.
Broken into its three functional parts, the structure looks like this.
| Field | Length | What it identifies | Example (020-5871748-1) |
|---|---|---|---|
| Airline prefix | 3 digits | The three-digit IATA accounting code assigned to the carrier that issued the waybill | 020 |
| Serial number | 7 digits | A sequential number assigned by the issuing carrier, unique within that carrier's own numbering block | 5871748 |
| Check digit | 1 digit | The remainder when the 7-digit serial number is divided by 7 | 1 |
Unlike a shipping container number, which mixes letters and digits and needs a conversion table before any math can happen, an AWB number is purely numeric end to end. That makes the arithmetic simpler than the ISO 6346 container check digit, but it does not make it foolproof, which is the part worth spending real time on.
Airline prefixes are assigned, not chosen, and they are publicly documented
The three-digit prefix is not arbitrary. It is the same accounting code IATA assigns each carrier for interline billing and settlement, reused as the front of every AWB number that carrier issues. A handful of real, published examples: 016 is United Airlines' code, and every ticket or waybill that carrier issues starts with 016. 020 is Lufthansa's code. 057 belongs to Air France. 160 is assigned to Thai Airways. 235 belongs to Turkish Airlines. Because the prefix identifies the issuing carrier specifically for accounting and liability purposes, not necessarily the airline whose aircraft the cargo physically flies on, a shipment tendered under an interline agreement can carry a Lufthansa-prefixed AWB number while actually moving on a partner carrier's flight for part of its routing. That distinction matters for a document pipeline: the prefix tells you who is contractually responsible for the waybill, which is what matters for claims and liability, not necessarily which airline's tracking portal will show live flight status.
| Prefix | Carrier |
|---|---|
| 016 | United Airlines |
| 020 | Lufthansa |
| 057 | Air France |
| 160 | Thai Airways |
| 235 | Turkish Airlines |
A document intake system that maintains even a partial table like this one gets a second, independent signal for free: if an extracted prefix does not correspond to any known carrier code at all, that is worth a manual review regardless of whether the check digit validates, because a nonexistent prefix cannot belong to a real waybill no matter what the arithmetic says.
The modulo 7 calculation, step by step
Once the airline prefix is set aside, the check digit calculation only ever touches the 7-digit serial number. The procedure has exactly two steps. First, take the 7-digit serial number as a plain integer. Second, divide that integer by 7 and keep the remainder. The remainder, a value between 0 and 6, is the check digit. IATA calls this an unweighted system specifically because, unlike the ISO 6346 container check digit, no position in the serial number is multiplied by a different weight before the division happens. Every digit simply contributes its normal place value, and the whole seven-digit number is divided as-is.
One useful consequence falls straight out of that: because a remainder after dividing by 7 can only ever be 0 through 6, a correctly formed AWB check digit can never be 7, 8, or 9. Any extracted AWB number ending in one of those three digits is invalid on its face, before you even run the division, which makes it a nearly free first-pass filter on OCR output.
A full worked example, computed from scratch
Take the Lufthansa-prefixed waybill number 020-5871748-1, a real, published, check-digit-valid AWB number. Strip the prefix and the trailing check digit, leaving the 7-digit serial: 5871748. Divide it by 7.
5,871,748 divided by 7 equals 838,821 with a remainder. Multiplying 838,821 by 7 gives 5,871,747. Subtracting that from the original serial number, 5,871,748 minus 5,871,747, leaves a remainder of 1. That remainder, 1, is the check digit. It matches the check digit actually printed on the waybill number, 020-5871748-1, exactly. That is the entire algorithm, run start to finish on a real number, landing on the real published answer.
A second published example, cited directly from IATA's own documentation on the standard, uses the serial number 8,114,074. Dividing 8,114,074 by 7 gives 1,159,153 with a remainder: 1,159,153 times 7 is 8,114,071, and 8,114,074 minus 8,114,071 leaves 3. The check digit is 3, and the full serial-plus-check-digit sequence is written as 81140743. A third example, this one commonly used in check digit training material, starts from the serial number 1,234,567. Divided by 7, that gives 176,366 with 1,234,567 minus 176,366 times 7 (which is 1,234,562) leaving a remainder of 5. The check digit is 5.
Verifying in the other direction: catching a real OCR misread
Computing a check digit from a clean serial number is only half of what verification does in an actual document pipeline. The more common task is the reverse: an OCR engine has already extracted all eight digits of the serial-plus-check-digit block from a scanned waybill, and the system needs to confirm the eighth digit matches what the first seven predict.
Go back to the Lufthansa number, 020-5871748-1. Suppose the scan is slightly degraded and the OCR engine misreads the sixth digit of the serial, a 4, as a 9, because of a smudge or a compression artifact. The extracted serial now reads 5871798 instead of 5871748, while the check digit position is read correctly as 1, since it is a physically separate character on the document. Divide the misread serial, 5,871,798, by 7: that gives 838,828 with a remainder. 838,828 times 7 is 5,871,796, and 5,871,798 minus 5,871,796 leaves 2. The math predicts a check digit of 2. The document actually shows 1. The mismatch is immediate and unambiguous, and the system flags the extraction for review before that misread number ever reaches a tracking query, a customs filing, or a rate calculation tied to the wrong shipment. This is the case that most explanations of the AWB check digit stop at, and it is genuinely useful. It is also not the whole story.
What the check digit cannot catch, and why that matters
Go back to the opening example. The OCR engine misreads the fourth digit of the same serial number, the 1 in the thousands position, as an 8. The extracted serial becomes 5878748 instead of 5871748. Divide 5,878,748 by 7: that comes out to 839,821 with a remainder. 839,821 times 7 is 5,878,747, and 5,878,748 minus 5,878,747 leaves 1. The predicted check digit is 1. The document's actual check digit is also 1. They match. The verification step passes, and the wrong serial number is accepted as correct.
This is not a rare coincidence, it is a structural property of unweighted modulo 7 arithmetic. Changing a single digit at any position by exactly plus or minus 7 changes the underlying value by that digit's place value multiplied by 7, which is always itself an exact multiple of 7, and a multiple of 7 never changes a remainder mod 7. Since digits only run 0 through 9, the only digit pairs that differ by exactly 7 are 0 and 7, 1 and 8, and 2 and 9. Any OCR misread that confuses one of those three pairs, in any position of the serial number, produces a check digit that still validates. Every other kind of single-digit misread, and the vast majority of possible OCR errors fall outside that narrow set of three digit pairs, gets caught reliably. The gap is real but bounded, and knowing exactly where it is lets a document pipeline compensate for it deliberately, for instance by treating 0, 1, 2, 7, 8, and 9 as a lower-confidence character class for AWB serial fields specifically, and routing anything containing them through stricter secondary review even when the check digit validates cleanly.
The second, more structural gap is the airline prefix itself. The check digit calculation never touches those three digits at all, which means a completely fabricated or transposed prefix attached to a genuinely valid serial-and-check-digit pair will pass check digit validation every single time, because the math never looks at the prefix in the first place. This is the mechanism behind a specific, well understood document fraud pattern in air cargo: a bad actor takes a real, structurally valid AWB number, one that will sail through any automated check digit test, and pairs it with a different prefix, either to misattribute a shipment to a carrier that never issued it, or to make a fabricated waybill look legitimate on paperwork presented to a customs broker, a bank under a letter of credit, or a warehouse release desk. Because the prefix is a real, publicly documented three-digit code, checking whether it corresponds to an actual assigned carrier is a separate, necessary step, not something the check digit does as a side effect. IATA's own DG AutoCheck tool, used to validate dangerous goods declarations submitted alongside air waybills, performs exactly this kind of AWB number validation automatically during document intake, which is a useful signal that treating this as a distinct pipeline step, not an afterthought, is standard practice rather than excessive caution. A pipeline that also processes dangerous goods declarations has extra reason to take this seriously, since a mismatched AWB reference on a DGD is one of the more consequential document errors in air cargo, given what it is attached to.
Where AWB verification fits against the bigger House and Master picture
An AWB number is not the only identifier that needs reconciling on an air shipment. Most air cargo that moves through a freight forwarder travels under two waybills at once: a Master Air Waybill issued by the airline to the forwarder for the whole consolidated load, and a House Air Waybill issued by the forwarder to each individual shipper for their portion of it. The two numbers are structurally independent. The MAWB always carries a real, IATA-assigned carrier prefix because an airline issued it. The HAWB is typically assigned from the forwarder's own numbering block and is not required to follow the three-plus-seven-plus-one IATA structure at all, since IATA Resolution 600a governs carrier-issued waybills, not house documents. A document pipeline that runs check digit validation only on whichever AWB number it happens to extract, without first determining whether that number is a MAWB or a HAWB, risks flagging a perfectly legitimate HAWB as invalid simply because it was never built to satisfy modulo 7 in the first place, or worse, silently accepting a HAWB formatted to look like a MAWB as if it carried the same legal weight. Getting MAWB and HAWB references straight, and reconciling them against each other rather than treating either one in isolation, is closely related territory covered in our post on master and house bill reconciliation, and the ocean freight equivalent of this same document-layer verification problem is covered in our piece on bill of lading processing.
Building AWB verification into an actual intake pipeline
In practice, a document processing pipeline handling air cargo paperwork needs three checks stacked together, not one. First, format validation: does the extracted string have exactly 11 digits, and does the trailing check digit fall in the 0 through 6 range that modulo 7 arithmetic can ever actually produce. Second, arithmetic validation: does dividing the extracted 7-digit serial by 7 produce the extracted check digit exactly. Third, prefix validation: does the extracted 3-digit prefix correspond to a real, currently assigned IATA carrier code, cross-referenced against a maintained table rather than assumed to be correct just because it is three digits long. Only when all three checks pass should an AWB number be treated as verified rather than merely well formatted, and even then, for the narrow digit-confusion cases described above, a pipeline processing high volumes of scanned or handwritten waybills is better served treating a validated-but-low-confidence extraction as a candidate for spot review rather than an automatic pass, particularly on fields the OCR engine itself flagged as low confidence before the check digit was ever computed.
What this catches in practice
Put together, these checks solve two distinct problems that look similar on the surface but have different failure modes. The first is transcription accuracy: an AWB number extracted from a scanned document, an EDI cargo message, or a manually keyed booking form either matches its own internal check digit or it does not, and for the overwhelming majority of possible single-digit errors, that mismatch is immediate and unambiguous, catching a bad number before it propagates into a tracking query, a customs entry, or a billing record built on the wrong shipment. The second is structural legitimacy: a check digit that validates tells you the serial number is internally consistent, nothing more, so confirming the prefix belongs to a real carrier, and confirming whether the number in hand is a MAWB or a HAWB before applying MAWB-specific expectations to it, are separate, necessary steps rather than something the modulo 7 math does automatically. Treating AWB verification as three stacked checks rather than one arithmetic test is the difference between a pipeline that catches most of what actually goes wrong with air waybill numbers, and one that catches only the errors the math happens to be good at catching.
Written by Nupura Ughade.
Frequently asked questions
An air waybill number is 11 digits under IATA Resolution 600a: a 3-digit airline prefix identifying the issuing carrier, a 7-digit serial number assigned sequentially by that carrier, and a 1-digit check digit computed from the serial number using an unweighted modulo 7 calculation.
Divide the 7-digit serial number by 7 and take the remainder. That remainder, always a value from 0 to 6, is the check digit. For example, the serial number 5871748 divided by 7 leaves a remainder of 1, so the check digit is 1 and the full number reads 5871748-1.
No. Since the check digit is a remainder from dividing by 7, it can only ever be 0 through 6. Any air waybill number ending in 7, 8, or 9 is invalid by construction, which makes it a fast, free first-pass filter on OCR-extracted AWB numbers before running the full division check.
Yes, in one specific case. Because modulo 7 arithmetic is unweighted, changing any single digit in the serial number by exactly plus or minus 7 leaves the remainder unchanged. The only digit pairs that differ by exactly 7 are 0 and 7, 1 and 8, and 2 and 9, so an OCR misread that confuses one of those pairs in any serial position produces a check digit that still validates even though the number is wrong.
No. The check digit calculation only ever uses the 7-digit serial number, not the 3-digit airline prefix. A fabricated or mismatched prefix attached to a genuinely valid serial-and-check-digit pair will pass check digit validation every time, which is why a separate step cross-referencing the prefix against real assigned IATA carrier codes is necessary for full verification.
Not necessarily. A Master Air Waybill is issued by the carrier and always carries a real IATA-assigned prefix under Resolution 600a. A House Air Waybill is issued by the freight forwarder from its own numbering block and is not required to follow the same 3-plus-7-plus-1 structure, so a pipeline should confirm which type of number it has before applying modulo 7 validation to it.
Related Blog Posts

Bill of Lading Processing: Straight vs Order Bill Types
A lender flags collateral as released based on the consignee field. Weeks later an endorsed original bill of lading turns up, and the cargo is already gone.

HS Code Classification: Why It Isn't a Simple Lookup
A toy company once convinced a US court its action figures were not human, and cut the import duty in half. That is what HS classification actually involves.

Advance Ship Notice Processing: Inside the EDI 856 Tree
A $50,000 PO ships correctly and still costs $2,000 in chargebacks, because the ASN's hierarchy, not the freight, was wrong.
Ready to Transform Your Lending Process?
See how DocsAPI's AI-powered industry classification can help you process loans faster, improve accuracy, and scale your operations.
