ISO 6346
Container Code Verifier

Rev 2022  ·  11-char BIC code  ·  Mod-11 check digit

Upload Excel or CSV File

Upload an Excel (.xlsx) or CSV (.csv) file with container IDs. A new file will be downloaded with validation results added as extra columns.

Help & FAQ

What makes a container ID valid?

A valid ISO 6346 container code is 11 characters in the form XXXU NNNNNN C:

  • XXX — owner code, any 3 uppercase letters (A–Z). Real containers use codes registered with the BIC; this checker doesn't verify that registry.
  • U / J / Z / R — equipment category:
    • U — freight container
    • J — detachable freight container-related equipment
    • Z — trailer or chassis
    • R — reefer (refrigerated) container
  • NNNNNN — 6-digit serial number (0–9).
  • C — check digit, derived from the first 10 characters (ISO 6346 Annex A).

Input is normalized before checking: case is ignored, and spaces and dashes are stripped — csqu-305438-3 and CSQU 305438 3 both validate as CSQU3054383.

Why did my ID fail?

Each result carries one or more error codes:

  • empty_input — the field was blank or just whitespace.
  • invalid_length — after stripping spaces and dashes, the code wasn't 11 characters.
  • invalid_owner_code — the first three characters weren't all A–Z letters.
  • invalid_category — the 4th character wasn't U, J, Z, or R. Common mistake: using D/H/S, which are size/type codes used elsewhere in the standard, not equipment categories.
  • invalid_serial — positions 5–10 weren't all digits.
  • invalid_check_digit_char — the 11th character wasn't a digit.
  • check_digit_mismatch — the code is structurally valid but the check digit is wrong. The result includes the expectedCheckDigit so you can see what the correct check digit should be.
What file formats can I upload?

.xlsx (Excel 2007+) and .csv are supported, up to 10 MB. Older .xls files are rejected — save them as .xlsx first.

The checker picks the column to validate by looking, in order, for a header named Container ID, container, or id; then for Asset ID or asset; then by scanning the first 20 data rows and choosing the column whose values best match the ISO 6346 character pattern. As a final fallback, the first column is used. Any header whose name contains type anywhere (e.g. Asset Type, containerType, subtype, prototype) is always skipped — those are category columns, not ID columns. The downloaded file contains the original data plus three added columns: ISO 6346 Status, ISO 6346 Details, and Formatted Code.

CSV files may use \n, \r\n, or \r line endings and may include a UTF-8 BOM. Embedded newlines inside quoted fields are preserved.

How do I use the API?

See the API Usage section below. Key limits: up to 1000 IDs per request, 100 characters per ID. Cross-origin requests are allowed. Append ?format=jsonl for newline-delimited JSON.

API Usage

You can also validate container IDs programmatically via the REST API:

POST /api/check
Content-Type: application/json

{
  "containerIds": ["MSCU1234561", "CSQU3054381"]
}

Response:

{
  "results": [
    {
      "containerId": "MSCU1234561",
      "valid": true,
      "errors": [],
      "formatted": "MSCU 123456 1",
      "expectedCheckDigit": 1
    },
    {
      "containerId": "CSQU3054380",
      "valid": false,
      "errors": [
        { "code": "check_digit_mismatch",
          "message": "Check digit mismatch: expected 3, got 0" }
      ],
      "formatted": "CSQU 305438 0",
      "expectedCheckDigit": 3
    }
  ]
}

Append ?format=jsonl to stream results as newline- delimited JSON (one ValidationResult per line, application/x-ndjson), which is easier to parse incrementally from scripts.

Validation errors on each result use stable code values so integrations can branch on them without string-matching messages: empty_input, invalid_length, invalid_owner_code, invalid_category, invalid_serial, invalid_check_digit_char, check_digit_mismatch.

Error responses (HTTP 400):

// Invalid JSON body
{ "error": "Invalid JSON body" }

// Missing or non-array containerIds
{ "error": "Request body must contain a \"containerIds\" array. Example: {\"containerIds\": [\"MSCU1234561\"]}" }

// Empty array
{ "error": "containerIds array must not be empty" }

// Too many IDs
{ "error": "Maximum 1000 container IDs per request" }

// Non-string item in array
{ "error": "All containerIds must be strings" }

// Individual ID too long
{ "error": "Each container ID must be 100 characters or fewer" }

Limits: up to 1000 IDs per request, 100 characters per ID. Cross-origin requests are allowed (Access-Control-Allow-Origin: *). An OpenAPI 3.1 spec is available at /openapi.json.

MCP (Model Context Protocol)

The same validator is also exposed as an MCP server at POST /api/mcp (streamable HTTP, spec 2025-06-18, stateless). AI clients can discover three tools: validate_container_id, validate_container_ids, and compute_check_digit. Point any MCP-aware client at the URL — no auth required.