UN/LOCODE Explained: The International Port & Location Code System
What those 5-letter codes on your shipping documents mean. Learn how UN/LOCODE works, where to find a port's code, and why it matters for tracking accuracy.
If you've ever looked at a bill of lading or a shipping invoice, you've probably seen 5-letter codes like CNSHA (Shanghai) or NLRTM (Rotterdam). These are UN/LOCODEs — the United Nations' standardized location codes used across global trade. Understanding them helps you decode any shipping document at a glance.
The structure: 2 country + 3 location
- First 2 characters: ISO 3166-1 alpha-2 country code (CN for China, NL for Netherlands, US for United States)
- Last 3 characters: a 3-letter location identifier, usually derived from the city name or port name (SHA from Shanghai, RTM from Rotterdam, LAX from Los Angeles)
- Optional 6th character: subdivision code (e.g. CNSHA1 for a specific terminal within Shanghai)
Where you'll see UN/LOCODE
- Bills of lading and shipping instructions
- Customs declarations
- Carrier booking systems
- Container tracking events
- Port-of-load / port-of-discharge fields
- Free trade agreement certificates of origin
Common examples
- CNSHA — Shanghai, China (world's busiest container port)
- CNNGB — Ningbo, China
- SGSIN — Singapore
- NLRTM — Rotterdam, Netherlands (Europe's largest port)
- DEHAM — Hamburg, Germany
- USLAX — Los Angeles, USA
- USLGB — Long Beach, USA
- AEJEA — Jebel Ali (Dubai), UAE
- KRPUS — Busan, South Korea
- MYPKG — Port Klang, Malaysia
Why UN/LOCODE matters for tracking
When you track a container, the origin and destination shown on the timeline are typically identified by UN/LOCODE. A consistent code system means that 'SHA', 'Shanghai', 'CNSHA' and 'Port of Shanghai' all unambiguously refer to the same physical location — no matter which carrier, freight forwarder, or customs system reports the event.
MariMetric uses UN/LOCODE as the canonical key for its port database. When you see a port in your tracking timeline, hover or click to see its official UN/LOCODE, country, and coordinates — making the data portable and verifiable.
Looking up a UN/LOCODE
The official UNECE registry at unece.org provides a searchable database of all UN/LOCODEs. For most shipping use cases, you'll find the code you need either on your own shipping documents or in your carrier's tracking UI.
Track a container now
Don't just read about it — try container tracking with a real number from MSC, COSCO, ONE, CMA CGM, or HMM.
Track a container nowRelated posts
Explore more across carriers, ports, and routes.
What is a Container Number? (BIC / ISO 6346 Explained)
ISO 6346Every shipping container has a unique 11-character identifier. Learn how container numbers are structured, who assigns them, and how to read them at a glance.
Learn moreDCSA Track & Trace v2.2: The Standard Behind Container Tracking
DCSAWhy the Digital Container Shipping Association's Track & Trace standard matters, what events it defines, and how MariMetric implements it for end users.
Learn moreShanghai to Rotterdam Transit Time in 2026: A Data-Driven Analysis
ShanghaiWe analyzed 12,400+ container movements on the Asia-Europe trade lane in H1 2026. Average transit time, best/worst carriers, and what to expect when shipping from Shanghai to Rotterdam in 2026.
Learn moreContainer Tracking
Learn how container tracking works and track shipments across every major carrier.
Learn more