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 Boonget4 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:
| Part | Example | Meaning |
|---|---|---|
| Owner code | CSQ | 3-letter owner code registered with the BIC |
| Category identifier | U | U = all freight containers (including ISO tanks), J = detachable container-related equipment, Z = trailers and chassis |
| Serial number | 305438 | 6 digits assigned by the owner |
| Check digit | 3 | Calculated 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):
| A | B | C | D | E | F | G | H | I | J | K | L | M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 |
| N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 37 | 38 |
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.
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Character | C | S | Q | U | 3 | 0 | 5 | 4 | 3 | 8 |
| Value | 13 | 30 | 28 | 32 | 3 | 0 | 5 | 4 | 3 | 8 |
| × weight | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256 | 512 |
| Product | 13 | 60 | 112 | 256 | 48 | 0 | 320 | 512 | 768 | 4096 |
Step 3: Add up, divide by 11, keep the remainder
- Sum of the products = 6,185
- 6,185 ÷ 11 = 562 remainder 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:
=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:
REGEXREPLACEremoves spaces and dashes, andUPPERmakes everything uppercaseREGEXMATCHchecks the format: 3 letters + U/J/Z + 7 digitsMAPwithSEQUENCE(10)goes through each position, turns letters into numbers and multiplies by the weight2^(i-1)CODE(ch)-55+INT((CODE(ch)-56)/10)converts a letter to its value from the table, skipping 11, 22 and 33 automaticallyMOD(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 →Comments
No comments yet. Be the first to share your thoughts or ask a question.
Read next
AppSheet Automation: Email Your Manager the Moment a Job Is Closed, No Code
Build your first AppSheet bot that sends an email every time someone closes a job, with the job name, time and who closed it. Builds on the "Close job" button from the previous article.
Build a Search Page for Your Google Sheets Data with Apps Script in 15 Minutes
Turn a sheet with thousands of rows into a simple web page where anyone on your team can type and find what they need, without opening the sheet.
Convert Thai Buddhist Era (B.E.) Dates in Google Sheets
Thai documents show years like 2567 instead of 2024. Here's how to turn Buddhist Era dates into real dates in Google Sheets, and back again, without breaking your calculations.