Fundamentals · 4 min read
What Is a UN/LOCODE? A Practical Guide to Port and Location Codes
UN/LOCODEs show up everywhere in shipping documentation. Here's what the code actually encodes, and how to read one.
A UN/LOCODE is a five-character code that identifies a specific port, airport, or inland location used in trade and transport — for example, NLRTM for Rotterdam or CNSHA for Shanghai. It's maintained by the United Nations Economic Commission for Europe (UNECE) and used across shipping documentation, customs systems, and logistics software worldwide as a standard, unambiguous way to reference a location.
How the code is structured
A UN/LOCODE has two parts: a two-letter country code (following ISO 3166-1, the same standard used for internet country domains) followed by a three-letter location code assigned within that country. NLRTM breaks down as NL (Netherlands) + RTM (Rotterdam). The location portion is usually — but not always — derived from the place name, and where two locations would produce the same three letters, UNECE assigns an alternative code.
Where you'll encounter UN/LOCODEs
- Bills of lading and shipping instructions, to specify load and discharge ports unambiguously
- Customs declarations and electronic data interchange (EDI) messages
- Port call and vessel tracking systems
- Charter parties, to define permitted trading ranges and named ports
- Freight and logistics software, as the standard key for location data
Why not just use the port name?
Port names collide across languages, transliterations, and countries — there are multiple "Santos," "San Pedro," and "Georgetown" locations worldwide, and the same port is spelled differently depending on the language of the document. A UN/LOCODE resolves that ambiguity with a single, language-independent identifier that any system, in any country, can parse the same way.
The code isn't just a shorthand — it's the thing that lets a Rotterdam customs system and a Shanghai freight platform agree on which port they're both talking about.
Zea Directory's ports database lists UN/LOCODEs alongside location, depth, and vessel-size data for thousands of ports worldwide, sourced from NGA maritime publications — useful if you're trying to confirm a code, check a port's operational limits, or see which companies operate through it.