Iso6346 container validate
iso6346-container-validate · version 1.0.0 · Identifiers & check digits · free, no key needed
Validate an 11-character ISO 6346 container number's mod-11 check digit and split the owner code, category and serial.
Use when you need to: validate a shipping container number · check digit for an iso 6346 container · is this container number valid.
Decide before calling
Read the versioned contract and the supported scope below. Reuse iso6346-container-validate@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use iso6346-container-validate@1.0.0 for validate a shipping container number. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- validate a shipping container number
- check digit for an iso 6346 container
- is this container number valid
- split a container number into owner code and serial
- verify a freight container checksum
- container number category identifier meaning
Not supported
- a live carrier or terminal container-tracking lookup
- decoding owner-code registrant names (needs the BIC owner-code directory)
- validating a chassis or swap-body number under a different national scheme
Behavior
- container_number is taken exactly as given: no trimming, no case folding. Length != 11 returns reason wrong_length; length 11 but not matching ^[A-Z]{3}[UJZ][0-9]{7}$ returns reason invalid_character; both leave owner_code/category/serial/check_digit null.
- owner_code = container_number[0:3], category = container_number[3] (one of U, J, Z), serial = container_number[4:10], check_digit = container_number[10], populated once length and charset pass.
- Letter values for the check digit: digits keep their value; letters start at A=10 and skip every multiple of 11 (so 11, 22 and 33 are never assigned), giving B=12 ... K=21, L=23, M=24 ... U=32, V=34 ... Z=38.
- Weighted sum over the 10 characters owner_code+category+serial (left to right): value(char[i]) * 2^i, i = 0..9. remainder = sum mod 11; the expected check digit is 0 when remainder is 10, else remainder.
Input
container_number(string, required): min length 1; max length 11
Output
valid(boolean, required)reason(one of null, "wrong_length", "invalid_character", "check_digit_mismatch", required)owner_code(string or null, required): pattern^[A-Z]{3}$category(one of null, "U", "J", "Z", required)serial(string or null, required): pattern^[0-9]{6}$check_digit(string or null, required): pattern^[0-9]$
Limits
- max container number bytes: 11
Example
Request input:
{
"container_number": "CSQU3054383"
}
Response:
{
"result": {
"valid": true,
"reason": null,
"owner_code": "CSQ",
"category": "U",
"serial": "305438",
"check_digit": "3"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "iso6346-container-validate",
"version": "1.0.0",
"input": {
"container_number": "CSQU3054383"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/iso6346-container-validate/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"container_number":"CSQU3054383"}'
The machine-readable contract is at /v1/tools/iso6346-container-validate/versions/1.0.0.
CLI
node cli.mjs run iso6346-container-validate 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Iccid validate: Validate a 19/20-digit ICCID's Luhn check digit, require the 89 major industry id, split issuer/account digits.
- Upu s10 validate: Validate a 13-char UPU S10 postal identifier's weighted mod-11 check digit, split service indicator and country.
- Imei validate: Validate a 15-digit IMEI's Luhn check digit or accept a 16-digit IMEISV, and split the TAC from the serial.
- Isin validate: Validate a 12-character ISIN's ISO 6166 Luhn check digit and parse its country prefix, NSIN and NSIN scheme.
- Imo number validate: Validate a 7-digit IMO ship identification number's weighted mod-10 check digit, with or without the 'IMO ' prefix.
- Vin validate: Validate a 17-char VIN's mod-11 check digit, split WMI/VDS/VIS, and give the model-year candidates for the year code.