A pilot's question on r/flying about how squawk codes function across international boundaries touches on a foundational but often misunderstood piece of ATC infrastructure. The questioner correctly identifies the core constraint: Mode A transponder codes are limited to a four-digit octal range, yielding 4,096 possible combinations (0000 through 7777), with several codes reserved for special use (7500 for hijacking, 7600 for lost communications, 7700 for general emergencies, and 1200 or 2000 as VFR/uncontrolled conspicuity codes in various regions). With tens of thousands of aircraft airborne globally at peak times, far exceeding that finite pool, the system necessarily relies on regional deconfliction rather than a single global assignment scheme.
The mechanics work largely as the poster suspects. Squawk codes are assigned locally by the ATC facility currently working an aircraft, and that facility coordinates code assignments with adjacent facilities to avoid duplicate codes appearing simultaneously within overlapping radar or ADS-B coverage areas. As an aircraft transits from one FIR to another, code changes are handled through pre-arranged coordination agreements between the transferring and receiving units, often without requiring pilot action, since the handoff frequency and squawk code are frequently passed together during the handover, or the code is simply carried over if no conflict exists downstream. On oceanic crossings, where radar coverage is absent and aircraft are tracked via procedural separation, HF/CPDLC position reports, and now increasingly ADS-C and space-based ADS-B, squawk code relevance diminishes considerably since secondary surveillance radar isn't painting the aircraft anyway. Codes typically get reassigned once the aircraft reenters domestic radar environments on the far side of the ocean, which is why a flight from the U.S. to Europe might squawk one code on departure, go effectively "unsquawked" from a radar-dependent standpoint over the North Atlantic (transponder still on and functional, just not being actively tracked by ground radar), and receive a fresh code from Shanwick, Shannon, or the relevant European approach control upon reentry into controlled radar airspace.
For working pilots, especially those flying internationally in Part 91K, 135, or airline operations, this matters less as a hard operational skill and more as situational awareness that reinforces why crews should never assume a squawk code is "theirs" indefinitely. Controllers will issue new codes as needed during handoffs, and crews should always confirm and set new codes promptly when instructed, since a stale or duplicated code can create real hazards, including false conflict alerts, misidentification in TCAS/ACAS resolution logic, or ATC confusion during coordination between adjacent facilities. This is particularly relevant in busy, overlapping airspace like the North Atlantic Tracks, European FIR boundaries clustered close together, or transitions into and out of oceanic control areas, where miscommunication about code changes has historically contributed to loss-of-separation events and near-miss incidents.
This topic also intersects with the broader industry shift toward ADS-B and satellite-based surveillance, which is gradually reducing reliance on the legacy 4,096-code Mode A/C system in regions with full ADS-B Out mandates and space-based tracking like Aireon's constellation. Mode S transponders already broadcast a unique 24-bit ICAO aircraft address that doesn't suffer from the same numerical scarcity, and as ADS-B adoption becomes more universal, squawk codes may increasingly serve a secondary or transitional role rather than being the primary means of aircraft identification. Still, until that transition is complete globally, the discrete code system remains a critical, if occasionally confusing, backbone of international air traffic coordination, and pilots crossing multiple FIRs should expect and properly execute code changes as a routine part of any long-haul or oceanic operation.