Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A passport MRZ check digit is the remainder of a modulus-10 calculation: map each character to its ICAO value, multiply the values by repeating weights 7, 3, 1, add the products, and take the total modulo 10. For the common TD3 passport, each check digit uses a specific line-2 field or set of fields; the composite digit does not cover every character on the line.

The 7-3-1 check-digit calculation

ICAO Doc 9303 Part 3 defines a modulus-10 checksum. Read the exact input characters from left to right, convert each to a value, multiply by the corresponding repeating weight, add the products, then take the remainder when the sum is divided by 10. That remainder is the check digit. The weights start again at 7 for each separate check-digit calculation.

MRZ character Value
Digits 0–9 The digit’s numeric value
Letters A–Z 10–35 in alphabetical order (A = 10, B = 11, …, Z = 35)
Filler < 0

For mapped values v[i], the calculation is sum(v[i] × [7, 3, 1][i mod 3]) mod 10. Filler characters contribute zero to the sum, but still occupy a position, so they do not pause or reset the weight sequence.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Example calculation

For the input 123, multiply 1 × 7, 2 × 3, and 3 × 1. The sum is 16, and 16 modulo 10 is 6, so the check digit is 6. For a letter, apply its mapped value: A is 10, so as a one-character input its product is 10 × 7 = 70, and its check digit is 0.

#1 Best Overall
HERO Neck Wallet - RFID Blocking Passport Holder, Easy to Conceal Travel Pouch (Army Grey)
  • LIFETIME REPLACEMENT GUARANTEE – We individually test every HERO Neck Wallet in the USA before shipping. And every order comes backed by our lifetime replacement guarantee. If anything ever goes wrong we will send you a replacement absolutely free!
  • HANDS-FREE TRAVEL POUCH – Our ultimate universal travel neck wallet conceals passports, IDs, credit cards, cash, iPhones (incl. 17 Pro Max without a bulky case), tickets, and valuables, keeping personal items hidden discreetly on the go.
  • PROTECTIVE RFID LINING – Each unisex passport wallet features multi-RFID layers that shield credit cards, bank cards, passports and any other personal information from potential e-theft.
  • SUPPORTS RUGGED ADVENTURES – We only use premium ripstop nylon fabric and heavy duty YKK zippers to make our passport travel wallets stronger, more durable, and more resilient for a lifetime of world-wide adventures.
  • STREAMLINED ACCESSIBILITY – A stylish, easy-to-use design, that’s comfortable and lightweight. Our HERO Neck Wallet makes it super easy to add or remove items, including passports & large smartphones, for quick travel access.

TD3 passport line-2 positions

The common TD3 passport format has 44 character positions on its second MRZ line. ICAO Doc 9303 Part 4 defines the following inputs and check-digit positions. Positions here are counted from 1, as a person reads the line.

Check Input characters Check digit location
Document number Positions 1–9 Position 10
Date of birth Positions 14–19 Position 20
Date of expiry Positions 22–27 Position 28
Composite Positions 1–10, 14–20, and 22–43, concatenated in that order Position 44

The composite input intentionally excludes positions 11–13 and 21. Do not calculate it over the whole line or include those skipped positions. The individual checks and the composite check are separate calculations, and each starts its weights at 7.

Rank #2
2 Pack Passport Cover With Card Slots RFID Blocking-White&Black
  • ※【Multi-Purpose】:The passport holder with 2 fuction, vaccine card holder and passport holder, transparent pocket is for the vaccine card, the passport wallet also has specified pace for credit cards and cash which is convenient for travellers.
  • ※【RFID Blocking】: The travel passport holder with RFID blocking shield material inside, it helps to keeo your persona information safe.
  • ※【Travel Must Have】The RFID passport and vaccine card holder combo keep your vaccine card and passport conspicuously in one case,very convenient to show up for inspections in anytime.
  • ※【Travel size】: Passport cover(Porta pasaporte mujer) is only 50g/1.7oz,adding no unnecessary bulk or weight.Passport book with dimension: 5.7"x 4.3" (L x W) fit passport book size 4.9"X3.4"
  • ※【Contents】The package including 2pcs vaccine passport holder.

Python validator for a TD3 line

This example validates the four check digits in a line-2 string. It requires exactly 44 characters and accepts only the MRZ alphabet: uppercase letters, digits, and <. It reports malformed input separately from a check-digit mismatch.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
WEIGHTS = (7, 3, 1)


def mrz_value(char):
    if "0" <= char <= "9":
        return ord(char) - ord("0")
    if "A" <= char <= "Z":
        return ord(char) - ord("A") + 10
    if char == "<":
        return 0
    raise ValueError(f"Invalid MRZ character: {char!r}")


def check_digit(text):
    total = sum(mrz_value(char) * WEIGHTS[i % 3]
                for i, char in enumerate(text))
    return str(total % 10)


def validate_td3_line2(line):
    if len(line) != 44:
        raise ValueError("A TD3 passport line 2 must contain 44 characters")

    # Reject unsupported characters even in positions outside the checks below.
    for char in line:
        mrz_value(char)

    checks = {
        "document number": (line[0:9], line[9]),
        "date of birth": (line[13:19], line[19]),
        "date of expiry": (line[21:27], line[27]),
        "composite": (line[0:10] + line[13:20] + line[21:43], line[43]),
    }
    return {
        name: {"expected": check_digit(data),
               "actual": actual,
               "valid": check_digit(data) == actual}
        for name, (data, actual) in checks.items()
    }

The slices use zero-based indexes: for example, human-readable positions 1–9 become Python slice line[0:9]. The composite slice combines positions 1–10, 14–20, and 22–43 in order, leaving out the specified gaps.

Rank #3
Sale
TOURSUIT RFID Blocking Passport Holder, Leather Travel Wallet, Dark Blue
  • Multifunctional Design: You will get one rfid passport holder that can store 1 passport, 4 * credit cards, boarding pass, tickets, ID card, coins, loose money, license, other documents etc. You can now quickly access and keep track of all your important items in one leather passport holder. The rfid passport wallet is one of your must have travel accessories
  • Keep Travel Documents Organized: This passport holder keeps all of your important documents organized, so you will never worry about forgetting anything again. A pasaportes case has room for a passport, business cards, credit cards, boarding passes
  • RFID Security: The leather passport holder rfid blocking has a special material to block RFID signals so that the passport organizer can protect your personal information in your passport and credit cards from unauthorized scans. RFID blocking shielding material of the passport holder men women is used to prevent thieves from swiping your credit card to steal your personal information in airports or crowded places
  • Compact Size: The size of passport holder women men is 4.0 inches W x 5.6 inches L x 0.4 inches D. The passport wallets are designed with stringent measurements to make sure they will fit your documents precisely. The rfid passport protector will hold any standard size passport book. The ultra-slim design allows our passport card holder and vax card holder to fit comfortably in your pocket, purse or handbag and is lightweight and easy to carry
  • High Quality Material: The passport case is made of durable padded premium leather material, which is lightweight, waterproof, anti-tear, anti-spills and shockproof. The beautiful cover of 3D embossing provides a comfortable soft touch feeling and professional look for the pasaporte case

JavaScript validator for a TD3 line

The same mapping and position rules apply in JavaScript. This version returns a result for each check and throws an error for a line with the wrong length or an unsupported character.

const WEIGHTS = [7, 3, 1];

function mrzValue(char) {
  if (char >= "0" && char <= "9") return char.charCodeAt(0) - 48;
  if (char >= "A" && char <= "Z") return char.charCodeAt(0) - 65 + 10;
  if (char === "<") return 0;
  throw new Error(`Invalid MRZ character: ${JSON.stringify(char)}`);
}

function checkDigit(text) {
  let total = 0;
  for (let i = 0; i < text.length; i++) {
    total += mrzValue(text[i]) * WEIGHTS[i % 3];
  }
  return String(total % 10);
}

function validateTD3Line2(line) {
  if (line.length !== 44) {
    throw new Error("A TD3 passport line 2 must contain 44 characters");
  }

  // Reject unsupported characters, including outside the checked fields.
  for (const char of line) mrzValue(char);

  const checks = {
    "document number": [line.slice(0, 9), line[9]],
    "date of birth": [line.slice(13, 19), line[19]],
    "date of expiry": [line.slice(21, 27), line[27]],
    "composite": [line.slice(0, 10) + line.slice(13, 20) + line.slice(21, 43), line[43]],
  };

  return Object.fromEntries(
    Object.entries(checks).map(([name, [data, actual]]) => {
      const expected = checkDigit(data);
      return [name, { expected, actual, valid: expected === actual }];
    })
  );
}

Both examples preserve the MRZ as characters rather than converting fields to numbers. That matters because leading zeroes and filler characters are part of the input sequence.

Rank #4
TOPBAG Passport Holder Family, Women Rfid Blocking Passport Wallet, Travel Document Organizer for Premium Wallets, Waterproof Passport Holders Bag for Women & Men Traveling, Credit Cards Case
  • 【High Quality travel passport holder】This passport wallet and passport book holder is made of super strong and durable polyester fabric, waterproof and stain resistant, lightweight material for easy carrying, strong zinc alloy zipper makes it more durable; Rfid passport wallet looks very attractive design, can be a great passport holder wallet choice for men, women, friends and family.
  • 【Rfid Blocking Protective passport bag】Family passport holder for 1 2 3 4 5 6 can effectively protect your card from being scanned, including 4+2 passport pockets, 1 boarding pocket sleeve, 1 transparent pocket, 1 quick access pocket, 1 pen holder, 2 zipper cash pockets, 6 Card slots, a coin mesh pocket and detachable key chain.
  • 【Not easy to crack travel accessories】This passport wallet for women has an exterior zipped pocket where you can fit things like your phone or tickets. Every time you use your travel passport wallet, boarding pass, ID or other documents, the family passport holder is strong and won't rip easily. It's perfect for airports, crowded markets, buses, trains, sporting events and festivals
  • 【Perfect travel pouch for passport and documents】Dimensions: (5 inches x 9 inches x 0.78 inches), The Family Travel Document Organizer Easy to Organize: Plenty of room for your travel essentials like passport, boarding pass, ticket, invoice , pen, checkbook, money, coins, keys and shipping documents.
  • 【Document holder for traveling】Our travel document holders are not only travel organizers but also family travel document organizers and credit card clutches. This spacious letter-sized travel organizer, sleek and modern multiple passport holder is designed for travel and durable enough to carry essentials for short or long trips.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Testing the calculation without claiming a passport is valid

Use small cases to check the mapping and weight cycle, then check the composite calculation against ICAO’s published TD3 example. ICAO’s example uses the specified lower-line input positions 1–43; the weighted products total 448, and 448 modulo 10 gives composite digit 8.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Digits: 123 gives 6 (7 + 6 + 3 = 16; remainder 6).
  • Letters: ABC maps to 10, 11, 12; 70 + 33 + 12 = 115, so the check digit is 5.
  • Filler: <1 gives 3; the filler contributes zero at weight 7, and the digit 1 uses the next weight, 3.
  • Length and positions: reject a TD3 line 2 unless it has 44 characters. A line of a different length cannot be safely checked with these TD3 positions.
  • Published composite example: reproduce ICAO’s concatenated inputs and confirm the expected result is 8; do not substitute the entire line for the specified composite sequence.

What a passing check digit does—and does not—show

ICAO describes the purpose this way: “The check digits permit readers to verify that data in the MRZ is correctly interpreted.” A match means the tested characters are consistent with the checksum rule. It does not establish that the passport is genuine, that its data is authentic, or that an electronic chip or digital signature is valid.

Best Value
Passport Holder Cover Wallet RFID Blocking, Travel Essentials
  • 【CLASSIC VERSION / HIGH-QUALITY】 - We are a team of 28 experienced craftsmen with more than 10 years' experience in handmade wallet industry. We strive for the highest standards. Every passport holder is rigorously examined before it leaves the factory. If our passport wallet doesn't meet the highest standards then we don't sell it.
  • 【TRAVEL MUST HAVES】 - The travel wallet is great holder for travel essentials. Yet With the hidden magnetic clasp design, the passport covers can maintain the beauty of the 3D embossing on the cover, and you can clip the passport and vaccine card holder combo, clamping your passport and cards.
  • 【RFID BLOCKING】 - Our Passport Cover is equipped with advanced RFID BLOCKING SECURE TECHNOLOGY, a stylish metal composite, engineered specifically to block 13.56 MHz or higher RFID signals, such as ID card, Credit card, Debit card, Driver license and keep your personal information securely everywhere.
  • 【HIGH-QUALITY SYNTHETIC LEATHER】 - The passport holder with vaccine card slot is designed specially for passport and vaccine card. Passport cover made from premium high-quality ECO-Friendly synthetic leather, touch soft and comfortably base on more sponge added.
  • 【GIFT】 - Every passport case is equipped with a metal pin, which is used to push the dot to open the slot on iPhone or other mobile phones to change SIM card when you travel internationally.

TD3 is not every travel document

This article’s positions apply to TD3 passports, the common two-line, 44-character-per-line format. Other machine-readable travel-document formats can have different line lengths, field layouts, and check-digit positions. Do not reuse these slices for TD1 or TD2 documents. For compliance work, consult the current ICAO Doc 9303 edition and applicable amendments; the cited Part 3 and Part 4 specifications are eighth-edition publications from 2021.

Sources: ICAO Doc 9303 Part 3, common specifications; ICAO Doc 9303 Part 4, TD3 specifications.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.