What Is UN/LOCODE? How to Read Port Codes
UN/LOCODE is the 5-character standard code for ports and logistics locations worldwide. Here is how to read it, where it is used and the mistakes to avoid.
UN/LOCODE is the 5-character standard location code maintained by the United Nations (UNECE) for ports, airports, inland terminals and other trade locations. If you are looking for a port code, this is usually what you need: the first two letters are the country, the next three identify the place within that country. Shanghai is CNSHA, Rotterdam is NLRTM and Istanbul is TRIST.
To look up a specific port, use our port code search. This article explains how to read a code and where you will run into it.
How a UN/LOCODE is built
A code has two parts:
| Part | Length | Meaning | Example | |---|---|---|---| | Country | 2 letters | ISO country code | CN, NL, TR, DE | | Location | 3 characters | The place within the country (letters, sometimes digits) | SHA, RTM, IST |
Codes are written either with a space (CN SHA) or joined (CNSHA). Both mean the same thing. Joined, upper-case writing is the norm in documents and systems.
The three-character location part is not always the first three letters of the city name. Many codes are abbreviations, some from older names. Do not guess a code; confirm it in the list.
The function field
The UN/LOCODE list also records which kinds of transport a location supports: for example port, rail terminal, road terminal or airport. A location being in the list does not guarantee that it has a seaport. When requesting an ocean freight quote, check that the code carries the port function.
Where port codes are used
- Freight quotes: They pin down the load and discharge ports and remove naming ambiguity, such as different spellings of the same port.
- Bill of lading and shipping instructions: Port of loading (POL) and port of discharge (POD) fields carry the code, or the name and code together.
- Booking and container tracking: Most carrier and tracking systems recognise locations by this code.
- Manifests and customs filings: Electronic filings generally use codes in their location fields.
- System integrations: ERP, transport management and rate sheets match far more easily when they all use the same code.
Examples
| Code | Place | |---|---| | CNSHA | Shanghai, China | | CNNGB | Ningbo, China | | NLRTM | Rotterdam, Netherlands | | DEHAM | Hamburg, Germany | | TRIST | Istanbul, Türkiye | | TRMER | Mersin, Türkiye |
These are only illustrations. Always check the current entry, and other terminals in the same area, in the list.
Step by step: reading a port code correctly
- Translate the first two letters into the ISO country. TR is Türkiye, CN is China.
- Look up the last three characters in that country's list rather than assuming.
- Check that the location has the port function.
- If a city has several ports or terminals, ask for the terminal name in the quote as well.
- Write both the code and the name on the quote request, booking and bill of lading instructions.
Common mistakes
- Guessing a code from the city name. It may point to a different place, or a system may reject it.
- Mistaking an airport or inland code for a seaport. One city can have both; check the function.
- Using an outdated code. The list is updated from time to time, so check the current version when preparing documents.
- Writing only the code. Without a name beside it, a human reviewer spots errors late.
- Mixing up different ports in one region. Ports in the same delta or bay carry different codes, and the cost and transit time can differ.
How a port code affects your quote
Ocean freight depends on the pair of loading and discharge ports. The wrong port means a wrong route and wrong local charges. No code implies a fixed price or transit time; for current conditions you need a quote.
Frequently asked questions
Is UN/LOCODE the same as an IATA or SCAC code? No. IATA codes identify airports and SCAC codes identify carriers. UN/LOCODE identifies locations. Do not mix an airport code up with a port code.
What is the difference between a port code and a postal code? A postal code is for addresses; UN/LOCODE points to a trade and transport location. A door-to-door shipment may need both.
What if I cannot find a port in the list? Try other spellings first (English name, older name, nearby city). If you still cannot find it, give the place name, country and, if possible, a map location when requesting a quote, and we will work out the closest suitable port with you.
Does the code change if I ship a full container or a partial load? The code stays the same, but the terminals and services available can differ by cargo type.
A short checklist for your quote request
- Port of loading: name + UN/LOCODE
- Port of discharge: name + UN/LOCODE
- Cargo type, approximate weight and volume
- Container type, or a request for a consolidated load
- Ready date and the delivery term you want (Incoterms)
- Pickup and delivery addresses if you need door-to-door
With these six items ready, a quote often takes a single round of questions; missing details slow it down.
How we work at Medius
When we receive a quote request we confirm the load and discharge ports with their codes, and if a location is unclear we clarify it with you before quoting. To get a quote for your route, contact us.
