Check Digit Calculator: Container OCR API

Instantly verify container numbers with built-in mathematical validation. Upload your raw logistics captures to test our check digit calculator for free, ensuring flawless data entry.

Visual breakdown of a shipping container number highlighting the final check digit, with a free test upload button powered by StructOCR.

The High Cost of Invalid Container Data

A single mistyped digit in a container number can disrupt an entire supply chain. The ISO 6346 standard uses a specific mathematical formula to generate a final check digit based on the owner code and serial number. When gate clerks or crane operators manually type these codes, human error inevitably leads to invalid check digits, causing database rejections, lost cargo, and billing disputes. Standard OCR tools merely read text without verifying the math, passing corrupt strings into your system. To see how our engine structurally prevents these errors, you can upload a test image to explore our core Container OCR capabilities completely free.

Algorithmic Verification on the Fly

Delivered strictly as a lightweight REST API to ensure seamless integration without the burden of heavy SDK dependencies, this endpoint is powered by our Logistics Container OCR engine. It acts as an automated gatekeeper for your data. The engine applies strict ISO 6346 validation automatically, calculating the mod-11 check digit in milliseconds to guarantee that only mathematically sound Container Codes enter your logistics software.

Live Demo: Container OCR

No registration required. Upload a file to test the extraction.

1
Upload
2
Results

Drop files here or click to browse

JPG · PNG · WebP  ·  up to 500 files · max 4.5 MB each

No files selected

Ready to use this in production? Get 20 free API calls — no credit card needed.

Get 20 Free API Calls →

Check Digit Application Scenarios

Automated Gate Entry Validation

Prevent trucks with invalid paperwork from entering the yard. The API instantly calculates and compares the visual check digit against the printed manifest. Ready to secure your terminal data? View flexible pricing to scale your processing limits using modern payment rails like USDT/USDC.

Intelligent Error Correction

Reconstruct missing characters effortlessly. If a serial digit is obscured by rust or dents, the API reverse-engineers the missing number using the visible check digit formula.

TOS Database Cleansing

Run historical audits on your Terminal Operating System (TOS) inventory by feeding existing images through the API to verify check digits and flag corrupted database records.

Mobile Verification Apps

Empower yard spotters with mobile tools that instantly highlight invalid container numbers with a red warning if the calculated check digit fails to match the visual read.

Technical Specs

  • Mod-11 Algorithm: Natively executes the complex ISO 6346 Modulo 11 weighting formula in milliseconds.
  • Edge Optimization: Deployed on Cloudflare's global edge network, ensuring ultra-low t1/t2 latency for rapid mathematical verification.
  • Input Versatility: Fully supports raw Base64 strings and direct multipart file uploads—ideal for secure logistics intranets.
  • Dependency-Free: Pure REST API architecture ensures zero dependency conflicts, avoiding the maintenance overhead of language-specific SDKs.

Key Features

  • Free Image Testing: Instantly upload container photos to test the check digit calculation accuracy before writing any integration code.
  • Granular Output: Cleanly separates the alphanumeric string, providing the exact `check_digit` and an `is_valid` boolean flag in a structured JSON object.
  • Harsh Environment Recovery: Mitigates deep shadows and peeling paint by utilizing the check digit logic to mathematically confirm borderline visual reads.

Integration & AI Prompts

Call the endpoint directly via HTTP. The API is designed for maximum security and edge performance, natively accepting direct multipart file uploads or Base64-encoded strings to keep your operations off public URLs.

import requests
import base64

# Prepare Base64 Image to calculate and verify the check digit
with open("container_side_capture.jpg", "rb") as image_file:
    base64_image = base64.b64encode(image_file.read()).decode('utf-8')

url = "https://api.structocr.com/v1/container"
headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "img": base64_image
}

try:
    print("Calculating Check Digit...")
    response = requests.post(url, headers=headers, json=payload)
    result = response.json()

    if result.get('success'):
        data = result['data']
        parsed = data.get('parsed', {})
        print("✅ Validation Complete!")
        print(f"Full ISO Code:  {data.get('container_number')}")
        print(f"Check Digit:    {parsed.get('check_digit')}")
        print(f"Math Valid:     {data.get('is_valid')}")
        print(f"Confidence:     {data.get('confidence')}")
    else:
        print(f"❌ Calculation Failed: {result.get('error')} - {result.get('message')}")

except Exception as e:
    print(f"An error occurred: {e}")

Standardized JSON Output

The API returns a cleanly parsed payload providing the full consolidated container number while explicitly highlighting the calculated check digit and validation status.

{
  "success": true,
  "data": {
    "container_number": "ZCSU8921655",
    "is_valid": true,
    "confidence": "High",
    "parsed": {
      "owner_code": "ZCS",
      "category": "U",
      "serial_number": "892165",
      "check_digit": "5"
    }
  }
}

Frequently Asked Questions

Can I test the check digit calculator API for free?

Absolutely. You can upload container images directly on our platform to see how the engine calculates and verifies the check digit completely free of charge.

How does the API use the check digit to fix OCR errors?

Because the API strictly enforces the ISO 6346 Mod-11 formula, if one character is unreadable due to physical damage, the engine can use the remaining characters and the check digit to mathematically deduce the missing value.

Do you provide SDKs for this calculation?

We focus entirely on providing a lightning-fast, universal REST API to prevent dependency conflicts across your stack. This ensures simple integration via standard HTTP requests whether you use Base64 strings or file uploads.

Explore More Container Solutions

Precise Data Extraction and Seamless Integration with AI-powered OCR API.

Empower your solutions with automated data extraction by integrating best-in class StructOCR via API seamlessly.

No credit card required • Full API access included