DocsAPI LogoDocsAPI

OCR for Logistics: What It Reads and Where It Fails (2026)

Nupura Ughade
Nupura Ughade
|
October 5, 2026
|
13 min read
In short

OCR can read almost every shipping, customs and freight document: bills of lading, air waybills, invoices, customs forms, labels and delivery receipts. It fails on look-alike digits, handwriting and legal meaning, so pair it with check digits and cross-document matching.

One digit. That is all it takes for a container number or an air waybill to point at someone else's cargo, and a 3 and an 8 look alike on a faded carbon copy. OCR for logistics reads bills of lading, air waybills, commercial invoices, packing lists, customs forms and labels. The setups that hold up treat check digits and cross-document matching as part of the job. Below: a document map, worked check digits, and one ocean shipment in order.

Which shipping and customs documents can OCR read?

Almost all of them, because they are printed or typed forms. OCR (optical character recognition) turns the image into text, then a document model finds fields such as shipper, consignee, container number, weight and value. Reading the words is the easy part. Catching one wrong digit, and knowing what the words legally mean, needs checks outside the OCR engine.

Take OCR for bills of lading: it reads parties, container and seal numbers, package counts, weight and cargo description. The risky field is the consignee box. On an order bill it often holds the words "to order of" a bank, not a name, and that wording decides who can claim the cargo. An extractor that treats the box as a name quietly turns a negotiable bill into a plain one. Our bill of lading guide explains the legal difference.

Document map: OCR for international shipping documents, field by field

The fourth column matters most: it is a test that turns an OCR misread into a visible error. Rows come from our logistics guides (linked below) and the sources at the end. Labels and vehicle registration have their own sections.

DocumentIssued byFields OCR must get rightCheck that catches an errorTypical failure
Commercial invoice and packing listSeller (invoice), shipper (packing list)Parties, description, quantity, unit price, currency, origin; carton counts, weights, marksLine totals add up; quantities match exactly; weights agree within a set toleranceSame goods, no shared words between the two, so text matching fails
Ocean bill of ladingCarrier (master), forwarder (house)Parties, notify party, container and seal numbers, pieces, weight, "to order" wording, originalsScan the consignee box for order or bearer wording; container check digit; house pieces sum to master"To order of [bank]" read as a name; one count mismatch holding a whole container
Air waybillAirline (master), forwarder (house)11-digit number, parties, pieces, weightModulo 7 on the 7-digit serial; prefix is a real airline code0/7, 1/8 and 2/9 misreads still pass
Dangerous goods declarationShipperUN number (4-digit hazard ID), proper shipping name, class, packing groupCross-check the UN number against the proper shipping nameUN1203 (gasoline) read as UN1230 (methanol), both valid
Verified gross mass (VGM) declarationShipperVerified gross mass, container number, method, signatoryMatch container and booking to the shipping instructionCorrect weight rejected because the container would not match
Certificate of originExporter, producer or importerGoods, HS (Harmonized System) number, origin rule claimed, signatory, dateRecompute the rule (regional value content or tariff shift)Signed certificate treated as proof, not a claim
Entry summary (CBP Form 7501)Importer or licensed broker, filed with US Customs and Border Protection (CBP)Entered value, HTS (US tariff) number, origin, dutyEntered value reconciles to the invoice after adjustmentsDuty figured on the raw invoice total
Customs power of attorney (CBP Form 5291)Importer or other principalPrincipal, agent, signer's authority, datesIn date (a partnership's runs 2 years at most), not revokedBroker files on an expired power of attorney
Proof of deliveryDriver, signed by receiverPRO (carrier reference), bill of lading or load number, date, pieces, exceptions, signatureMatch on reference number plus date, weight and laneReference number off by one digit, so the receipt attaches to nothing
Freight invoiceCarrierBase charge, weight and class, accessorials, fuel surcharge, totalLines add up to the total; accessorials supported by the bill of ladingTotal read, line items skipped
Warehouse receiptWarehouseDepositor, goods, order or bearer wording, nonnegotiable legendLook for order or bearer wording and a nonnegotiable legend in any phrasingNon-negotiable receipt financed as if negotiable

Three failure patterns repeat.

  • Look-alike digits. 3 and 8, 0 and 7, 1 and 8. Check digits catch most swaps, not all.
  • Meaning and matching, not text. "To order of" wording, a nonnegotiable stamp or a signed certificate can be read perfectly and still be judged wrong, and a delivery receipt can be read correctly and still fail to join to its shipment.
  • Handwriting and phone photos. Our OCR accuracy benchmark measured character accuracy on handwritten forms at 61% (Tesseract), 73% (PaddleOCR) and 78% (DocsAPI, our product), and on phone-photographed receipts at 58%, 82% and 76%. It had no shipping documents, so read these as stand-ins.

How do check digits catch a misread container or air waybill number?

A check digit is computed from the other digits, so a misread usually breaks the math. Container numbers follow ISO 6346: 4 letters, 6 digits and 1 check digit, computed with powers of 2 and modulo 11 (the remainder after dividing by 11). Air waybills use an unweighted modulo 7 on a 7-digit serial. Run it right after OCR.

Container example. Take CSQU305438, the published ISO 6346 example. Letters become numbers (C is 13, S 30, Q 28, U 32; the table skips 11, 22 and 33). Multiply the ten values by 1, 2, 4, 8, 16, 32, 64, 128, 256 and 512. The products (13, 60, 112, 256, 48, 0, 320, 512, 768, 4096) sum to 6,185. Divide by 11 and the remainder is 3, so the full number is CSQU3054383.

Now say OCR reads the 3 in the example number HLXU659347 as an 8. The correct check digit is 7, but the misread HLXU659847 needs a 9, so the printed 7 no longer fits and the error is caught at once. All 54 single-digit substitutions in the serial of CSQU305438 changed the result. Our container number verification guide has the full algorithm.

Air waybill example. Take AWB 020-5871748-1: prefix 020 (the airline), serial 5871748, check digit 1. The serial divided by 7 leaves 1, matching the printed check digit. If OCR reads the 4 as a 9 (5871798), the remainder becomes 2 and the number is flagged. If it reads the 1 as an 8 (5878748), the remainder is still 1 and the wrong number passes.

Of all 63 single-digit substitutions on that serial, 58 are caught. The 5 misses are all swaps of digits 7 apart (0/7 or 1/8 here, 2/9 elsewhere), which change the number by a multiple of 7. Our air waybill verification guide covers the prefix check and the rest.

The container check has a blind spot too: in a brute-force run over 3,000 random container numbers we generated, every missed single-digit serial error swung the remainder between 10 and 0, which both print as check digit 0. Neither check proves the number belongs to the right box or shipment, so match it against the booking or bill.

Code we ran (Python 3, standard library only):

def iso6346_check(first10):
    values, v = {}, 10
    for letter in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
        if v % 11 == 0:
            v += 1
        values[letter], v = v, v + 1
    total = sum((values[c] if c.isalpha() else int(c)) * 2 ** i
                for i, c in enumerate(first10))
    return total % 11 % 10

def awb_check(serial7):
    return int(serial7) % 7

for n in ("CSQU305438", "HLXU659347", "HLXU659847"):
    print(n, iso6346_check(n))
for s in ("5871748", "5871798", "5878748"):
    print(s, awb_check(s))

Output: 3, 7, 9, then 1, 2, 1, matching the hand arithmetic.

What does OCR for freight forwarders need to digitize on one ocean shipment?

For one ocean shipment into the US, digitize documents in the order they appear, because each is checked against the one before: shipping instructions, invoice and packing list, special-cargo papers, security filing data, container and VGM, house and master bills, letter of credit papers, customs entry, demurrage records, delivery receipt and freight invoice.

This assumes the forwarder issues the house bill and the goods enter the US. Other lanes change the customs steps, not the logic.

  1. Shipping instructions and booking. These feed the bill of lading, so every later document is checked against them. Incoterms clause extraction shows what the 11 Incoterms 2020 rules change and why FCA and FOB move risk at different points.
  2. Commercial invoice and packing list. Quantities must tie out even when descriptions share no words (19 CFR 141.86 lists what an invoice must state). Packing list reconciliation shows what to match on instead of text.
  3. Special-cargo and origin papers. A dangerous goods declaration if needed, a certificate of origin if a trade agreement is claimed. Dangerous goods declaration processing shows how a transposed UN number stays valid, and certificate of origin verification shows the math behind a US-Mexico-Canada Agreement claim.
  4. Security filing (ISF) data. Due 24 hours before loading at the foreign port (19 CFR 149.2). Manufacturer, ship-to party, origin and the six-digit HTS number come off the invoice. HS code classification explains why choosing the code is not a lookup.
  5. Container loading. Read the container number and seal, and run the check digit. The VGM must reach the carrier and terminal before loading. VGM declaration processing covers how a valid weight still gets a container rolled.
  6. House and master bills. Reconcile container, seal, total pieces and weight, and check negotiability on each layer. Master and house bill reconciliation shows how one wrong piece count can hold an entire container.
  7. Letter of credit papers, if used. The bank checks documents, not goods. Letter of credit document compliance walks through the UCP 600 (the letter of credit rulebook) 21-day presentation rule.
  8. Customs entry. CBP Form 3461 requests release, and the entry summary (Form 7501) follows within ten working days. Entry summary processing covers the fields that set duty, and customs power of attorney processing explains why a partnership's lapses after two years.
  9. Container pickup and return. Gate records and hold codes decide who owes demurrage and detention. Demurrage and detention documentation lists the records that prove the timeline.
  10. Delivery. Proof of delivery processing shows how a receipt with a misread PRO number still matches on date, weight and lane.
  11. Billing. Carrier invoices carry accessorial charges (extras such as liftgate or detention) the bill of lading may not authorize. Freight invoice automation covers EDI 210, and freight bill audit automation covers the overcharges an audit catches and the 180-day dispute window.

How does OCR for customs forms work, and who decides the classification?

Customs is where a confident wrong answer costs real money, so it is also where OCR should be most modest. OCR reads customs forms and the papers behind them. It does not decide what the goods are, what they are worth for duty, or whether an origin claim holds. In the US, entries are typically filed electronically in ACE (CBP's Automated Commercial Environment), so OCR mostly reads the invoices, bills and certificates the filing is built from.

Three forms to know: CBP Form 3461 (Entry/Immediate Delivery), Form 7501 (the entry summary) and Form 5291 (the customs power of attorney). On the 7501, get entered value right, not the invoice total: it starts from the invoice, removes non-dutiable charges such as international freight and insurance, and adds dutiable items such as assists.

The importer of record is legally responsible for the entry summary, including the classification and value it states, even when a licensed broker files it. And 19 CFR 111.1 defines customs business to include preparing documents intended for CBP, "whether or not signed or filed by the preparer." Reading text off an invoice is one thing. Deciding classification or value for someone else's filing may raise the licensed-broker question. This is not legal advice, so ask a licensed customs broker or trade counsel.

For small parcels, the duty-free de minimis rules changed in 2025. Our Section 321 guide explains what changed and why order splitting is hard to spot.

Does OCR for shipping labels replace barcode scanning?

No. Read the barcode first and use OCR for what it does not carry. A barcode gives you a tracking number or pallet code with a built-in check digit. OCR is for the printed ship-to address, reference lines, and labels whose barcode is torn, faded or missing.

A UPS MaxiCode symbol (a 2D barcode) carries the postal code, country code and service class in its structured part, so the street address and recipient name usually still come from printed text. Pallet and carton labels in the GS1 system carry an SSCC (Serial Shipping Container Code): 18 digits made of an extension digit, company prefix, serial reference and check digit.

The SSCC check digit is modulo 10. Take the 17-digit base 12345678901234567 and multiply digits from the right by 3, 1, 3, 1 and so on. The products sum to 155, and (10 minus 155 mod 10) mod 10 is 5, giving 123456789012345675, which matches a published example. At the dock, a scanned SSCC is matched to the advance ship notice, and a broken match sends the carton to manual exceptions (see our advance ship notice guide). If the barcode will not scan, OCR the digits printed under it and run the same check.

Can OCR for vehicle registration read a VIN reliably?

Yes for the printed fields, with a check. OCR can read the VIN, plate, make, year, owner and expiry date from a registration card. In North America the VIN's ninth character is a check digit, so most misreads fail the math. OCR cannot tell you a registration is current or genuine. Only the issuing agency can.

It comes up when carriers register trucks and when vehicles are shipped. Layouts differ by state and country, so test per issuer. A VIN has 17 characters and never contains I, O or Q (49 CFR 565), so any of those in OCR output is a misread: an O is almost certainly a 0, an I a 1.

The check digit sits at position 9. Convert letters with the table in 49 CFR 565.15, multiply each position by its weight (8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2), add, and divide by 11. The remainder is the check digit, with 10 written X. For the example VIN 1M8GDM9AXKP042788 the sum is 351, 351 divided by 11 leaves 10, and the ninth character is X. The check is compulsory in North America and China but not Europe, so do not reject a European VIN for failing it. Registrations carry the owner's name and address, so treat the images as personal data.

Does OCR for warehouses replace barcode scanners?

No. Barcode scanners and EDI already cover structured data. OCR earns its place on paper and PDFs that arrive from outside: packing slips, bills of lading, delivery receipts and warehouse receipts. It struggles with handwriting and unfamiliar formats, so plan human review for low-confidence fields.

OCR for supply chain work splits by format. If a partner sends EDI (electronic data interchange), such as an advance ship notice (856), carrier status message (214) or freight invoice (210), the data is already structured, so parse it instead of running OCR. Our EDI 214 guide shows why status code D1 does not always mean delivered. OCR is for suppliers who still send paper or PDFs.

Warehouse receipts need one extra check: a negotiable receipt (order or bearer wording) transfers the right to the goods by endorsement and a non-negotiable one does not, which matters to any inventory lender. See our warehouse receipt guide.

OCR for shipping companies (carriers, truckers, parcel firms) hits the same wall. Printed bills of lading read easily, handwritten delivery receipts do not, and the bigger bottleneck is joining each receipt to one shipment. Pallet, a vendor selling an AI product for freight documents, argues template-based OCR breaks on format variety, and its author describes a mid-sized carrier needing 500 bill of lading templates. Read that as one vendor's view, and test any tool on your own documents.

Where to start on your shipments

Begin with the numbers that carry check digits. That accuracy is free.

  • Freight forwarder or NVOCC (a non-vessel-operating carrier that issues house bills): start with shipping instructions, house and master bills and the container check digit.
  • Carrier, trucker or parcel company: fix delivery receipt matching and freight invoice lines first, because those drive payment.
  • Warehouse operator: keep barcodes for labels and pallets, and point OCR at supplier packing slips and driver paperwork.
  • Trade or inventory lender: classify negotiable versus non-negotiable wording first, then see OCR for lending and underwriting.
  • Choosing a tool: score field-level accuracy on your own sample (see how to measure OCR accuracy), and ask whether it validates container and air waybill numbers or only reads them.

To try your own files, DocsAPI (our product) lists bills of lading, proofs of delivery and packing lists on its shipping documents page. We have not tested any vendor's shipping tools for this page.

Sources

We checked these on September 21, 2026.

Limits: apart from the published examples, the numbers used for arithmetic are made up, and the brute-force counts are our own runs, not industry statistics. US rules (CBP, ACE) shape the customs parts, and other countries differ. Nothing here is legal or customs advice. Facts about each document type come from the 21 logistics guides linked above, which cite their own sources.

Common questions

Frequently asked questions

We found no independent public benchmark for shipping documents, and vendor figures are usually measured on the vendor's own samples. Our own benchmark has no shipping documents either. Accuracy depends on scan quality, handwriting and format variety, so score field-level accuracy on a sample of your own documents and count the errors that reach downstream systems, not just characters read.

Collect a sample of real documents for each type, including the ugly ones: handwritten delivery receipts, faxes and phone photos. Label the correct values by hand for the fields that matter, such as container number, consignee and weight. Score each field as right or wrong, and report accuracy per field and per document type. Also count how many wrong values your check digits and matching rules catch.

OCR does not change who may file. Under 19 CFR 111.1, customs business includes preparing documents intended to be filed with CBP, whether or not the preparer signs or files them, and the importer of record stays responsible for the entry summary. Where a tool's role ends and a broker's begins is a legal question, so ask a licensed customs broker or trade counsel.

Templates work when you see a few stable formats, because coordinates and labels rarely change. They struggle when many carriers and forwarders send different layouts, since each new layout needs setup and upkeep. AI models handle layout variety better but can read a wrong digit with full confidence. With either, add validation such as check digits, and route low-confidence fields to a person.

Not necessarily. A master air waybill is issued by the airline and carries a real IATA prefix, so the modulo 7 check applies. A house air waybill comes from the forwarder's own numbering block and need not follow the 3-plus-7-plus-1 structure. Confirm which type you have before applying the check, or you may reject a legitimate house number.

Exporters or their forwarders file Electronic Export Information (EEI) in the Automated Export System. Shipments valued at $2,500 or less per Schedule B number, from one U.S. principal party in interest to one ultimate consignee on a single conveyance, are generally exempt under 15 CFR 30.37(a), but license requirements and other rules can still force a filing. Check the current Census Foreign Trade Regulations before relying on the exemption.

An SSCC (Serial Shipping Container Code) is an 18-digit GS1 code that identifies a logistics unit such as a pallet or carton, and it ends in a modulo 10 check digit. A tracking number is assigned by a carrier to follow a shipment, and formats vary by carrier. A label can carry both, so software should read the barcode type before deciding what a number means.

No. OCR reads what is printed. A check digit can show that a number was misread, but a forged document can carry perfectly valid numbers: a real waybill serial paired with a made-up airline prefix passes the modulo 7 test. Genuineness needs checks against the issuer, the carrier's own records or the other documents in the shipment.

Usually not. EDI messages such as the 856 advance ship notice, the 214 status message and the 210 freight invoice are already structured, so you parse the fields directly. Use OCR for the partners who send paper, scans, PDFs or photos. If some partners send EDI and others send paper, you will need both, and you should reconcile the two streams against each other.

Nupura Ughade

Content Marketing Lead, DocsAPI

Nupura Ughade creates clear, insightful content on OCR, document AI, and fintech. She combines technical depth with real-world finance use cases to help engineers and operations leaders navigate digital transformation with confidence.

Want to see it on your own documents?

Try our free OCR tool in your browser, or book a demo to see how DocsAPI reads the document types covered in this guide.