Back to blog
Jul 20, 20265 min read· MariMetric Team

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.

UN/LOCODEPortsStandardsTracking

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 now

Related posts

Explore more across carriers, ports, and routes.