The assignment of these codes is governed by IATA Resolution 763, and it is administered by the IATA's headquarters in Montreal. The codes are published semi-annually in the IATA Airline Coding Directory.
Airport codes arose out of the convenience that the practice brought pilots for location identification in the 1930s. Initially, pilots in the United States used the two-letter code from the National Weather Service (NWS) for identifying cities. This system became unmanageable for cities and towns without an NWS identifier, and the use of two letters allowed only a few hundred combinations; a three-letter system of airport codes was implemented. This system allowed for 17,576 permutations, assuming all letters can be used in conjunction with each other.
IATA codes should not be confused with the FAA identifiers of US airports. Most FAA identifiers agree with the corresponding IATA codes, but some do not, such as Saipan whose FAA identifier is GSN and its IATA code is SPN, and some coincide with IATA codes of non-US airports.
Canada's unusual codes–which bear little to no similarity with any conventional abbreviation to the city's name–such as YUL in Montréal, and YEG in Edmonton, originated from the two-letter codes used to identify weather reporting stations in the 1930s. The letters preceding the two-letter code follow the following format:
"Y" – Indicating “yes”, this letter was used when the station shared its location with an airport.
"W" – When the weather-reporting station shared its location with no airport, this letter hinted at “Without”.
"X" – Suggesting that the last two letters of a code were in use by a Canadian airport, this letter was put in place.
"Z" – This letter indicated that an airport code had been used for the identification of an airport in the US.
Most large airports in Canada have codes that begin with the letter "Y", [unreliable source?] although not all "Y" codes are Canadian (for example, YUM for Yuma, Arizona, and YNT for Yantai, China), and not all Canadian airports start with the letter "Y" (for example ZBF for Bathurst, New Brunswick). Many Canadian airports have a code that starts with W, X or Z, but none of these are major airports. When the Canadian transcontinental railways were built, each station was assigned its own two-letter Morse code. VR stands for Vancouver, TZ Toronto, QB Quebec, WG Winnipeg, SJ Saint John, YC Calgary, OW Ottawa, EG Edmonton, etc. When the Canadian government established airports, it used the existing railway codes for them as well. If the airport had a weather station, authorities added a "Y" to the front of the code, meaning "Yes" to indicate it had a weather station or some other letter to indicate it did not. When international codes were created in cooperation with the United States, because "Y" was seldom used in the US, Canada simply used the weather station codes for its airports, changing the "Y" to a "Z" if it conflicted with an airport code already in use. The result is that most major Canadian airport codes start with "Y" followed by two letters in the city's name: YOW for Ottawa, YWG for Winnipeg, YYC for Calgary, and YVR for Vancouver, whereas other Canadian airports append the two-letter code of the radio beacons that were the closest to the actual airport, such as YQX in Gander and YXS in Prince George.
Four of the ten provincial capital airports in Canada have ended up with codes beginning with YY, including YYZ for Toronto, Ontario, YYJ for Victoria, British Columbia, YYT for St. John's, Newfoundland, and YYG for Charlottetown, Prince Edward Island. Canada's largest airport is YYZ  for Toronto–Pearson (As YTZ was already allocated to Toronto City Airport, the airport was given the station code of Malton, Mississauga, where it is located.) YUL is used for Montréal–Trudeau (UL was the ID code for beacon in the city of Kirkland, now the location of Montréal–Trudeau). While these codes make it difficult for the public to associate them with a particular Canadian city, some codes have become popular in usage despite their cryptic nature, particularly at the largest airports. Toronto's code has entered pop culture in the form of "YYZ", a song by the rock band Rush which utilizes the Morse code signal as a musical motif. Some airports have started using their IATA codes as brand names, such as Calgary International Airport (YYC) and Vancouver International Airport (YVR).
Numerous New Zealand airports use codes that contain the letter Z, to distinguish them from similar airport names in other countries. Examples include HLZ for Hamilton, ZQN for Queenstown, and WSZ for Westport.
Sometimes the airport code reflects pronunciation, rather than spelling, such as NAN, which reflects the pronunciation of "Nadi" as [ˈnandi] in Fijian, where "d" is realized as the prenasalized stop[ⁿd].
For many reasons, some airport codes do not fit the normal scheme described above. Some airports, for example, cross several municipalities or regions, and therefore, use codes derived from some of their letters, resulting in DFW for Dallas/Fort Worth, DTW for Detroit–Wayne County, LBA for Leeds–Bradford (Airport), MSP for Minneapolis–Saint Paul, and RDU for Raleigh–DUrham. Other airports—particularly those serving cities with multiple airports—have codes derived from the name of the airport itself, such as JFK for New York's John F. Kennedy or CDG for Paris' Charles de Gaulle (see below). In some cases, the code comes from the airport's unofficial name, such as Kahului Airport's OGG (for local aviation pioneer Jimmy Hogg).
Cities with multiple commercial airports
In large metropolitan areas, airport codes are often named after the airport itself instead of the city it serves, while another code is reserved which refers to the city itself which can be used to search for flights to any of its airports. For instance:
Berlin (BER) – Self-named (BER). The city also previously had three airports, Tempelhof (THF), Schönefeld (SXF) and Tegel (TXL), with THF and TXL both now closed. The former Berlin Schönefeld Airport was absorbed into Berlin Brandenburg Airport, with the old Schönefeld terminal becoming Terminal 5.
Sometimes, a new airport is built, replacing the old one, leaving the city's new "major" airport (or the only remaining airport) code to no longer correspond with the city's name. The original airport in Nashville, Tennessee, was built in 1936 as part of the Works Progress Administration and called Berry Field with the designation, BNA. A new facility known as Nashville International Airport was built in 1987 but still uses BNA. This is in conjunction to rules aimed to avoid confusion that seem to apply in the United States, which state that "the first and second letters or second and third letters of an identifier may not be duplicated with less than 200 nautical miles separation." Thus, Washington, D.C. area's three airports all have radically different codes: IAD for Washington–Dulles, DCA for Washington–Reagan (District of Columbia Airport), and BWI for Baltimore (Baltimore–Washington International, formerly BAL). Since HOU is used for William P. Hobby Airport, the new Houston–Intercontinental became IAH. The code BKK was originally assigned to Bangkok–Don Mueang and was later transferred to Suvarnabhumi Airport, while the former adopted DMK. The code ISK was originally assigned to Gandhinagar Airport (Nashik's old airport) and later on transferred to Ozar Airport (Nashik's current airport). Shanghai–Hongqiao retained the code SHA, while the newer Shanghai–Pudong adopted PVG. The opposite was true for Berlin: the airport Berlin–Tegel used the code TXL, while its smaller counterpart Berlin–Schönefeld used SXF; the Berlin Brandenburg Airport has the airport code BER, which is also part of its branding. The airports of Hamburg (HAM) and Hannover (HAJ) are less than 100 nautical miles (190 km) apart and therefore share the same first and middle letters, indicating that this rule might be followed only in Germany.
Cities or airports changing names
Many cities retain historical names in their airport codes, even after having undergone an official name/spelling/transliteration change:
Orlando International Airport was founded as Orlando Army Air Field #2 but uses MCO for having been renamed McCoy Air Force Base in 1959 in honor of a wing commander who crashed at the field in 1958. It was converted in the early 1960s to joint civilian/military use and renamed Orlando Jetport at McCoy, then renamed Orlando International Airport in the early 1980s.
Louis Armstrong New Orleans International Airport was originally named Moisant Field after daredevil aviator John Moisant, who died in 1910 in an airplane crash on agricultural land where the airport is now located. Its IATA code MSY was derived from Moisant Stock Yards, as Lakefront Airport retained the code NEW.
Other airport codes are of obscure origin, and each has its own peculiarities:
Nashville uses BNA for its former name as Berry Field, henceforth Berry Nashville Airport
Louisville Muhammad Ali International Airport is SDF for Standiford Field, its original name (Dr. Elisha David Standiford who, as a businessman and legislator, played an important role in Louisville transportation history and owned part of the land on which the airport was built.)
Some European cities have a different name in their respective language than in English, yet the airport code represents only the English name. Examples include:
CGN - Cologne/Köln (Germany)
CPH - Copenhagen/København (Denmark)
FLR - Florence/Firenze (Italy)
GVA - Geneva/Genève (Switzerland)
OPO - Oporto/Porto (Portugal)
PRG - Prague/Praha (Czechia)
VCE - Venice/Venezia (Italy)
VIE - Vienna/Wien (Austria)
Lack of codes
There are several airports with scheduled service that have not been assigned ICAO codes that do have IATA codes. For example, several airports in Alaska have scheduled commercial service, such as Stebbins and Nanwalek, which use FAA codes instead. There are also airports with scheduled service for which there are ICAO codes but not IATA codes, such as Nkhotakota Airport/Tangole Airport in Malawi or Chōfu Airport in Tokyo, Japan. There are also several minor airports in Russia (e.g. Omsukchan Airport) which instead use internal Russian codes for booking. Flights to these airports cannot be booked through the international air booking systems or have international luggage transferred there, and thus, they are booked instead through the airline or a domestic booking system. Thus, neither system completely includes all airports with scheduled service. Several heliports in Greenland have 3-letter codes used internally which might be IATA codes for airports in faraway countries.
Use in colloquial speech
Some airports are identified even in the colloquial speech by their airport code. The most notable examples are LAX, DFW and JFK.