🇹🇭 อ่านฉบับภาษาไทย →

What Is the Last Digit of a Container / ISO Tank Number? The ISO 6346 Check Digit, Plus a Google Sheets Formula to Validate It

The last digit of a container number isn't random. It's a check digit that catches typos. Here's how it's calculated step by step, and a Google Sheets formula that validates a whole column of container numbers.

🚢Free tool for this articleContainer / ISO tank number checkerOpen →
Kumron BoongetKumron Boonget
4 Dec 2026 · 4 min read

If you work at a depot, in shipping or in logistics, you type container numbers like CSQU 305438 3 every day. Ever wondered why the last digit is written apart from the rest, sometimes inside a box?

That digit is the check digit. It's calculated from the first 10 characters according to the ISO 6346 standard, and it lets you check whether a container number was typed or written down correctly. Get one character wrong, and in most cases the check digit no longer matches.

The 11 characters of a container number

Take CSQU 305438 3:

PartExampleMeaning
Owner codeCSQ3-letter owner code registered with the BIC
Category identifierUU = all freight containers (including ISO tanks), J = detachable container-related equipment, Z = trailers and chassis
Serial number3054386 digits assigned by the owner
Check digit3Calculated from the 10 characters before it

Note Codes like 22T6 on the container are the size-type code. They are not part of the check digit calculation.

Calculating the check digit, step by step

Step 1: Turn letters into numbers

Digits keep their own value. Letters use this table (notice that 11, 22 and 33 are skipped, because they are multiples of 11):

ABCDEFGHIJKLM
10121314151617181920212324
NOPQRSTUVWXYZ
25262728293031323435363738

Step 2: Multiply by the position weight

The first position is multiplied by 1, and the weight doubles at each position: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512.

Position12345678910
CharacterCSQU305438
Value13302832305438
× weight1248163264128256512
Product13601122564803205127684096

Step 3: Add up, divide by 11, keep the remainder

  1. Sum of the products = 6,185
  2. 6,185 ÷ 11 = 562 remainder 3
  3. The remainder is the check digit → 3, matching CSQU 305438 3 ✓

Caution If the remainder is 10, the check digit is 0. The standard advises against serial numbers that produce a remainder of 10, but some containers in service still have them.

Why have a check digit at all?

When container numbers are typed into a system, an EIR or a damage report, the most common mistakes are one wrong digit or two neighbouring digits swapped, such as 305438 becoming 304538. This calculation is designed to catch both kinds of mistake in the digits, which is why terminal and shipping line systems use the check digit to reject wrong container numbers before they are saved.

Validate a whole column in Google Sheets

Put your container numbers in column A (spaces or dashes are fine), then paste this formula in B2:

code
=IFERROR(LET(c,UPPER(REGEXREPLACE(A2,"[^A-Za-z0-9]","")),IF(NOT(REGEXMATCH(c,"^[A-Z]{3}[UJZ][0-9]{7}$")),"Invalid format",LET(s,SUM(MAP(SEQUENCE(10),LAMBDA(i,LET(ch,MID(c,i,1),IF(REGEXMATCH(ch,"[0-9]"),VALUE(ch),CODE(ch)-55+INT((CODE(ch)-56)/10))*2^(i-1))))),d,MOD(MOD(s,11),10),IF(d=VALUE(RIGHT(c,1)),"✓ Valid","✗ Wrong, should be "&d)))),"Invalid format")

Fill it down the column. You'll get one of three results:

  • ✓ Valid the container number passes
  • ✗ Wrong, should be X the check digit doesn't match, so a character was mistyped. Check it against the container or the documents
  • Invalid format not 4 letters followed by 7 digits

How the formula works:

  • REGEXREPLACE removes spaces and dashes, and UPPER makes everything uppercase
  • REGEXMATCH checks the format: 3 letters + U/J/Z + 7 digits
  • MAP with SEQUENCE(10) goes through each position, turns letters into numbers and multiplies by the weight 2^(i-1)
  • CODE(ch)-55+INT((CODE(ch)-56)/10) converts a letter to its value from the table, skipping 11, 22 and 33 automatically
  • MOD(MOD(s,11),10) takes the remainder after dividing by 11, and turns a remainder of 10 into 0

Tip Combine it with conditional formatting to colour the "✗" cells red. You'll spot wrong container numbers instantly, even in thousands of rows.

Just need to check a few numbers without opening a sheet? Use the container number checker: type a number and see the result instantly, with the calculation table, and if two digits were swapped it suggests the number you probably meant.

Summary

The check digit is a small safeguard that keeps wrong container numbers out of your system. If your work involves typing container or tank numbers, add this formula to your sheet and stop chasing containers with mistyped numbers.

🚢Free tool for this articleContainer / ISO tank number checkerOpen →
#ISO 6346#Check Digit#ISO Tank#Google Sheets
Kumron Boonget
Kumron Boonget

Operations professional at a container and ISO tank depot in Thailand. He builds the systems his team uses every day with Google Sheets, Apps Script and AppSheet, from search pages to repair tracking and automatic alerts, and shares how to build them in plain language for non-programmers.

Comments

No comments yet. Be the first to share your thoughts or ask a question.

Leave a comment
Comments are reviewed before they appear.

Read next