Understanding UN/LOCODE Format: A Complete Guide for Freight Forwarders — Global LOCODE Hub
Published: 2026-07-30 · Global LOCODE Hub Research
What Is a UN/LOCODE?
The UN/LOCODE is a standardized five-character code used worldwide to identify trade and transport locations — seaports, airports, inland terminals, rail stations, and border crossing points. It is maintained by the United Nations Economic Commission for Europe (UNECE) under Recommendation 16, first issued in 1981 and updated annually. The system exists because shipping documentation, customs filings, and carrier systems need an unambiguous, language-independent way to refer to a location.
Before UN/LOCODE, freight forwarders relied on port names spelled in various languages and scripts, which created costly errors in bills of lading and customs declarations. A single five-character code eliminates that ambiguity. Today, UN/LOCODE is embedded in electronic messaging standards (EDIFACT, XML), customs systems, and carrier tracking platforms.
The Five-Character Structure
A UN/LOCODE always has five characters, structured in two parts. The first two characters are the ISO 3166-1 alpha-2 country code — the same two-letter code used in internet domains (US for United States, CN for China, DE for Germany). The remaining three characters are a location identifier that is unique within that country. The code is conventionally written with a space between the country and location portions, though both forms are accepted.
| UN/LOCODE | Location | Country | Type |
|---|---|---|---|
| US LAX | Los Angeles | United States | Seaport |
| NL RTM | Rotterdam | Netherlands | Seaport |
| SG SIN | Singapore | Singapore | Seaport |
| DE FRA | Frankfurt Airport | Germany | Air Cargo Hub |
| DE DUI | Duisburg | Germany | Inland Terminal |
| AE JEA | Jebel Ali | UAE | Seaport |
The three-character location portion is assigned by UNECE and has no inherent meaning — it is simply a unique identifier. However, in many cases the location portion matches a well-known abbreviation: LAX for Los Angeles, RTM for Rotterdam, SIN for Singapore. For airports, the location portion often matches the IATA airport code.
Function Designators: What the Location Does
Beyond the five-character code, UNECE assigns function designators that describe what kind of operations a location supports. These are single-letter codes: B for border crossing, C for road transport, F for ferry port, I for inland clearance depot, P for port (seaport), R for rail station, T for terminal, and several others. A single location can have multiple function designators.
For example, a major seaport like Rotterdam has function designators for port, rail, and ferry, reflecting its multi-modal role. An inland terminal like Duisburg has designators for rail and road, but not port. These designators help freight forwarders understand at a glance whether a location can handle a specific transport mode. Our inland terminals directory and seaports directory are organized around these function categories.
How to Use UN/LOCODEs in Shipping Documentation
UN/LOCODEs appear in nearly every layer of international shipping documentation. On a bill of lading, the ports of loading and discharge are identified by LOCODE. On a customs declaration, the entry and exit points use LOCODE. In electronic manifest systems like the US Importer Security Filing (ISF/10+2) and the EU Import Control System (ICS2), LOCODEs are mandatory fields. Carrier tracking platforms use LOCODEs to standardize event location data across different systems.
The practical rule for freight forwarders is simple: always use the official UN/LOCODE rather than a free-text port name. This prevents transcription errors, ensures compatibility with customs systems, and speeds up document processing. If you are unsure of a code, look it up in the Global LOCODE Hub database or the official UNECE directory before submitting documentation. A wrong LOCODE can delay customs clearance and incur demurrage charges.
Common Mistakes and How to Avoid Them
The most common LOCODE mistake is confusing similar codes. For example, US NYC (New York) and US NWK (Newark) are close geographically but refer to different port complexes. CN SHA (Shanghai) and CN SHG (another Shanghai-area code) can both appear in documentation. Always verify the code against an authoritative source before use.
Another mistake is using a deprecated or merged code. Ningbo (NB) and Zhoushan (ZN) were historically distinct LOCODEs before their operational merger into Ningbo-Zhoushan; some older documentation still uses the separate codes. When in doubt, use the current official code from UNECE. For related reading, see our analysis of top container ports by TEU volume and the China-Europe rail freight corridor guide.
Frequently Asked Questions
What is a UN/LOCODE?
A UN/LOCODE is a five-character code assigned by the United Nations Economic Commission for Europe (UNECE) to identify trade and transport locations. It consists of a two-letter ISO country code followed by a three-character location identifier, such as NL RTM for Rotterdam.
How many characters are in a UN/LOCODE?
A UN/LOCODE is always five characters: the first two are the ISO 3166-1 alpha-2 country code, and the remaining three are a location identifier that is unique within that country. The code may be written with a space (NL RTM) or without (NLRTM).
Where can I find the official UN/LOCODE list?
The official UN/LOCODE list is maintained by UNECE and published at unece.org/trade/cefact/unlocode. The directory is updated annually and is free to download. Our site mirrors a subset of the most commercially relevant codes.
Is UN/LOCODE the same as IATA airport code?
No. UN/LOCODE covers seaports, airports, inland terminals, and other transport locations, while IATA codes identify airports specifically. However, for many airports the three-character portion of the UN/LOCODE matches the IATA code, such as NL AMS for Amsterdam Schiphol.
Data sourced from UNECE UN/LOCODE Directory and port authority publications. For reference only.