The IATA code: the one you see
The three-letter codes on tickets, boarding passes and luggage tags (LHR, JFK, DXB) are assigned by IATA, the International Air Transport Association. They exist so that booking systems, baggage sorting and timetables can identify roughly 9,000 commercial airports without ambiguity in three characters. Airlines, travel agencies and every booking site on the internet run on these codes.
Some are obvious abbreviations (AMS for Amsterdam, BER for Berlin). Some preserve history: LAX was simply LA until the industry standardized on three letters in the late 1940s and appended an X. Others are named after the airport rather than the city, like CDG (Charles de Gaulle) or JFK.
The ICAO code: the one pilots use
Air traffic control, flight plans and aviation weather use a different system: four-letter ICAO codes from the International Civil Aviation Organization. The first letter or two identify the region and country: all of mainland Britain starts with EG (Heathrow is EGLL), the continental United States uses K (KJFK), Portugal uses LP (Madeira is LPMA).
Because ICAO codes are structured geographically, every airfield on earth can have one, including thousands of small strips that will never see an airline and so never get an IATA code. That is why our database has far more ICAO idents than IATA codes.
Metropolitan codes
Cities with several airports also get a metropolitan IATA code that means "any airport here": LON covers Heathrow, Gatwick, Stansted, Luton, City and Southend; NYC covers JFK, LaGuardia and Newark; TYO covers Haneda and Narita. Booking searches accept them, but your ticket always shows the specific airport.
Looking codes up
Our lookup accepts either system, or the airport or city name, and returns the airport with both codes, its exact location and elevation, and the destinations it serves with direct flights. Developers can use the same data through the free JSON API.
Where the data comes from
Airport records come from OurAirports, a public-domain dataset maintained by a global community since 2007. Direct-flight destinations are adapted from Wikipedia's airline and destination tables (CC BY-SA), which are kept current under a strict sourcing policy. Everything is refreshed monthly on our own servers.