Tracking Code Example: What Carrier Numbers Look Like and How to Check Them
← All posts
GuideNov 12, 2026· 8 min read

Tracking Code Example: What Carrier Numbers Look Like and How to Check Them

A tracking code example is most useful when it shows the structure behind the number, not just a random string. Four layouts cover most parcels you will meet: RR473124829GB (a 13-character UPU S10 code used for international mail), 9212391234567812345670 (a 22-digit USPS package code), 1Z9999999999999999 (the 18-character UPS pattern), and 037654321000000007 (an 18-digit GS1 SSCC from a pallet or carton label). Three of those four end in a check digit you can verify in code, which matters when the number came from a typist, a customer email, or OCR on a label photo.

The examples here are built from the published specifications. They are not live shipments, so do not expect them to return a tracking history.

This post covers what each format looks like, how its check digit works, how a label ID differs from a tracking code, and a short Python checker for numbers read off labels. For reading the rest of the parcel label, including addresses and the barcode cross-check, see shipping label OCR.

Tracking code examples by format

Format Example Length Structure Check digit
UPU S10 (international post) RR 473 124 829 GB 13 2 letters, 8-digit serial, check digit, 2-letter country Weighted modulo 11
USPS IMpb package code 9212 3912 3456 7812 3456 70 22 (up to 26) Application identifier, service type, Mailer ID, serial, check digit MOD 10
UPS 1Z9999999999999999 18 1Z followed by 16 letters and digits Not published by UPS
GS1 SSCC (pallet or carton) (00) 037654321000000007 18 after the (00) Extension digit, company prefix, serial reference, check digit GS1 modulo 10

FedEx, DHL, and most national carriers have their own domestic formats, often plain digit strings of 10 to 15 characters. Their check methods are either undocumented in public or vary by product, so treat a match on length as a hint, not proof of which carrier issued the number.

UPU S10: the international mail format

When a parcel crosses borders through national postal operators, it usually carries an S10 identifier. The UPU S10 standard fixes it at 13 characters in four parts:

  • Characters 1 and 2: a service indicator, such as RR for registered items or EE for EMS. The first letter names the product type.
  • Characters 3 to 10: an eight-digit serial number, padded with leading zeros.
  • Character 11: a check digit.
  • Characters 12 and 13: the ISO country code of the operator that issued it, such as GB, US, or CN.

The standard calls this the “2-9-2” format and notes that spaces are allowed in the printed version for readability. The check digit uses weights 8, 6, 4, 2, 3, 5, 9, 7 across the serial. For 47312482, the weighted sum is 200, the remainder after dividing by 11 is 2, and 11 minus 2 gives a check digit of 9. A result of 10 becomes 0 and a result of 11 becomes 5. So RR473124829GB is a valid S10 code, and RR473124828GB is not.

The same standard warns that a string with the right shape is not automatically an S10 identifier. Retailers and logistics companies print other barcodes that happen to have two letters, nine digits, and two letters. The check digit filters out most of them.

USPS package codes

USPS labels carry an Intelligent Mail package barcode (IMpb). Publication 199 defines its package identification code as a two-digit channel application identifier (92, 93, 94, or 95), a three-digit service type code, the Mailer ID, a serial number, and a MOD 10 check digit. With a nine-digit Mailer ID the result is 22 digits. The guide’s own worked example is 9212 3912 3456 7812 3456 70.

To compute the MOD 10 digit, take the code without its last digit. Starting from the rightmost digit, multiply every other digit by 3, add the rest unchanged, and find the amount that brings the total up to the next multiple of 10. For the example, the total is 180, so the check digit is 0.

One detail trips up parsers. A concatenated USPS barcode can also carry routing data: 420 followed by the destination ZIP Code, then the tracking code. The human-readable digits under the barcode leave out that routing prefix, so a scanner and the printed text return different strings for the same parcel. Strip the 420 and ZIP before you compare.

UPS 1Z numbers

The UPS tracking page says tracking numbers usually start with 1Z, and the common package format is 18 characters: 1Z plus 16 letters and digits. UPS also issues shorter formats for some services, including 12-digit and T-prefixed numbers, and tracks freight by PRO number.

You will find breakdowns online that split the 16 characters into shipper account, service code, and package number with a final check digit. UPS does not publish that check method on its tracking page, so this post does not rely on it. For UPS, check the shape and confirm the number through the carrier’s API or tracking page.

GS1 SSCC on pallet and carton labels

Business-to-business shipments often carry a Serial Shipping Container Code. The GS1 Logistic Label Guideline makes the SSCC the one mandatory element on a logistic label. It is 18 digits, printed after the application identifier (00), and its last digit uses the GS1 check digit method, which is the same alternating 3 and 1 weighting as the USPS MOD 10. For 03765432100000000, the check digit is 7, so the full SSCC is 037654321000000007.

An SSCC identifies the pallet or carton, not the carrier movement. A pallet can carry an SSCC and a carrier tracking number on separate labels, and receiving systems usually match the SSCC against a despatch advice. The packing list OCR post shows that reconciliation step.

What is a label ID?

A label ID is usually the identifier a shipping platform gives to the label object it created, not the number the carrier tracks. In the ShipEngine API, for example, a label has a label_id such as se-28529731 that the platform generates, and a separate tracking_number such as 782758401696 that comes from the carrier. The label endpoints use the label ID to fetch, void, or track the label inside the platform, while customers and carrier sites need the tracking number.

Other systems use similar names for their own records: a WMS label number, a print job ID, or a return label reference. If someone asks you for “the label ID”, check which system they mean before you send them a tracking code, and keep the two in separate fields in your database. Mixing them causes the familiar support ticket where a customer pastes se-... into a carrier site and gets nothing.

Check tracking codes read by OCR

When a tracking code comes from OCR on a label photo, the common errors are predictable: O read for 0, I or l read for 1, a dropped space, a stray hyphen. A check digit catches most of them, and it catches the ones a format regex lets through. The script below normalizes look-alike letters only where the format expects a digit, identifies the format, and runs the matching check.

import re
import sys

# OCR look-alikes, applied only where the format expects a digit
TO_DIGIT = str.maketrans({"O": "0", "Q": "0", "D": "0", "I": "1", "L": "1", "Z": "2", "S": "5", "B": "8"})


def s10_check_digit(serial: str) -> int:
    """UPU S10: weights 8 6 4 2 3 5 9 7, then 11 - (sum mod 11); 10 -> 0, 11 -> 5."""
    total = sum(int(d) * w for d, w in zip(serial, (8, 6, 4, 2, 3, 5, 9, 7)))
    check = 11 - total % 11
    return {10: 0, 11: 5}.get(check, check)


def mod10_check_digit(body: str) -> int:
    """USPS Pub 199 and GS1: from the right, weight 3, 1, 3, 1... and round up to a multiple of 10."""
    total = sum(int(d) * (3 if i % 2 == 0 else 1) for i, d in enumerate(reversed(body)))
    return (10 - total % 10) % 10


def classify(raw: str) -> dict:
    text = re.sub(r"[\s()-]", "", raw.upper())

    # UPU S10: 2 letters, 8 digits, 1 check digit, 2-letter country code
    m = re.fullmatch(r"([A-Z]{2})([A-Z0-9]{9})([A-Z]{2})", text)
    if m:
        digits = m.group(2).translate(TO_DIGIT)
        if digits.isdigit():
            ok = s10_check_digit(digits[:8]) == int(digits[8])
            return {"code": m.group(1) + digits + m.group(3), "format": "UPU S10", "check": "pass" if ok else "fail"}

    # UPS 1Z: 18 characters. UPS does not publish the check method, so test shape only.
    if re.fullmatch(r"1Z[A-Z0-9]{16}", text):
        return {"code": text, "format": "UPS 1Z", "check": "shape only"}

    digits = text.translate(TO_DIGIT)
    if digits.isdigit():
        # USPS concatenated barcode data: strip AI 420 + 5-digit ZIP when present
        if digits.startswith("420") and len(digits) in (30, 34):
            digits = digits[8:] if len(digits) == 30 else digits[12:]
        if len(digits) in (22, 26) and digits[:2] in ("92", "93", "94", "95"):
            ok = mod10_check_digit(digits[:-1]) == int(digits[-1])
            return {"code": digits, "format": "USPS IMpb", "check": "pass" if ok else "fail"}
        # GS1 SSCC, with or without the (00) application identifier
        sscc = digits[2:] if len(digits) == 20 and digits.startswith("00") else digits
        if len(sscc) == 18:
            ok = mod10_check_digit(sscc[:-1]) == int(sscc[-1])
            return {"code": sscc, "format": "GS1 SSCC", "check": "pass" if ok else "fail"}

    return {"code": text, "format": "unknown", "check": "review"}


if __name__ == "__main__":
    for line in sys.stdin:
        if line.strip():
            print(line.strip(), "->", classify(line))

It needs Python 3 and nothing else. Feed it one code per line:

python3 check_tracking.py < samples.txt
RR 473 124 829 GB -> {'code': 'RR473124829GB', 'format': 'UPU S10', 'check': 'pass'}
RR473I24829GB -> {'code': 'RR473124829GB', 'format': 'UPU S10', 'check': 'pass'}
RR473124828GB -> {'code': 'RR473124828GB', 'format': 'UPU S10', 'check': 'fail'}
9212 3912 3456 7812 3456 70 -> {'code': '9212391234567812345670', 'format': 'USPS IMpb', 'check': 'pass'}
9212 3912 3456 7812 3456 71 -> {'code': '9212391234567812345671', 'format': 'USPS IMpb', 'check': 'fail'}
1Z9999999999999999 -> {'code': '1Z9999999999999999', 'format': 'UPS 1Z', 'check': 'shape only'}
(00) 037654321000000007 -> {'code': '037654321000000007', 'format': 'GS1 SSCC', 'check': 'pass'}
ORDER 58213 -> {'code': 'ORDER58213', 'format': 'unknown', 'check': 'review'}

The second line is the case that justifies the script. OCR read a capital I where the label printed 1. The normalizer fixed it because that position must be a digit, and the check digit confirmed the repaired code. If the repair had produced a different valid-looking number, the check digit would almost always fail and send it to review.

To get the raw text in the first place, run the label photo through the OCRskill /ocr endpoint, which returns Markdown, and pull candidate codes out with a regex before passing them to classify:

curl https://api.ocrskill.com/ocr \
  -H "Authorization: Bearer $API_KEY" \
  -F "file=@label.png" > label.md

A free key from get-key.json is enough to test. OCR returns the printed characters, not the decoded barcode, so when a scanner can read the bars, compare the two readings as described in the shipping label post.

Limits of format checks

  • A passing check digit is not a live shipment. It proves the string is internally consistent. Only the carrier’s tracking system can tell you the parcel exists and where it is.
  • Single check digits miss some errors. A single modulo 10 or modulo 11 digit catches most one-character mistakes, but not all, and some double errors cancel out. Keep the photo for review.
  • Normalization can overreach. Mapping S to 5 or B to 8 is right inside a digit field and wrong anywhere else. Apply it per position, as the script does for the S10 serial, never to the whole OCR output.
  • Formats change. Carriers add products and lengths. Pub 199 alone allows several layouts. Re-check the specification when a valid-looking code from a known carrier starts failing.
  • Codes you design yourself can be made far more robust than carrier numbers. If you write codes on parcels by hand, the handwritten parcel code system post covers a restricted alphabet and a Damm check digit.

Conclusion

Most tracking codes can be identified from their shape, and three common families, UPU S10, USPS IMpb, and GS1 SSCC, also carry a check digit you can verify in a few lines of code. That makes the check digit the cheapest quality gate in any pipeline that reads codes from photos or forms: run it before you call a carrier API, and send failures to a person with the image. Keep label IDs from shipping platforms in their own field, accept UPS and other undocumented formats on shape alone, and let the carrier confirm the rest.