United Federation of Planets
In the fictional universe of Star Trek the United Federation of Planets (UFP) is the interstellar government with which, as part of its space force Starfleet, most of the characters and starships of the franchise are affiliated. Commonly referred to as "the Federation", it was introduced in the original Star Trek television series. The survival, success, and growth of the Federation and its principles of freedom have become some of the Star Trek franchise's central themes.
The Federation is an organization of numerous planetary sovereignties, including Earth and Vulcan. The franchise focuses on Starfleet, the exploration and defence arm of the Federation, rather than the government. Viewers are rarely given details of the internal workings of the government; however, many episodes refer to the rules and laws that the Federation imposes on the characters and their adventures.

Development
Early in the first season of Star Trek, Captain Kirk had said the Enterprise's authority came from the United Earth Space Probe Agency. Bases visited in the series were labeled "Earth Outposts". In August 1966, Gene L. Coon was hired by Gene Roddenberry as a writer for Star Trek. Actor William Shatner credits Coon with injecting the concepts of Starfleet, Starfleet Command and the United Federation of Planets into the show. One of the first teleplays Coon was credited with was "A Taste of Armageddon", where an ambassador on the Enterprise is referred to as a Federation official.
Eventually, the series became an allegory for the current events of the 1960s counterculture, placing great emphasis on an anti-war message and depicting the United Federation of Planets, a vast interstellar alliance founded on the enlightened principles of liberty, equality, justice, progress, and peaceful co-existence, as an idealistic version of the United Nations.

Reception
The optimistic view of the future present in the Federation has been highlighted as unique among most science fiction, showing how "evolved" and "civilized" the future could conceivably be. Much debate has centered on how the materialist application of a post-scarcity economy in the Federation is incompatible with its own idealist ethics. It has been described, along with the series as a whole, as a vehicle to explore what it means to be human, as well as exploring mankind's efforts to build a better society. Other writers have noted that Star Trek's Federation has the same logistical and philosophical difficulties of other utopian economic and political schemes that make it seem unrealistic.In 2020, Screen Rant noted the Star Trek: The Next Generation episode "First Contact" for exploring the United Federation of Planets and how it sometimes struggles with contact with aliens.

In-universe portrayal
Like many things in Star Trek, episodes and films may reference entities or laws within the Federation, but viewers are never given a broad view of its inner workings. Many contemporary terms are assigned to the Federation, but parallels to current government bodies and their roles and responsibilities are pure speculation on the part of fans and critics.In the timeline of Star Trek, the Federation was founded in 2161, after the events of Star Trek: Enterprise but before those of the other series in the franchise. Its founding members were Earth, Vulcan, Andoria, and Tellar. Over time it has expanded to include many more worlds through peaceful voluntary association. Some notable ones include Bajor, Trill, Betazed, and Bolarus IX. References to the size of the Federation vary, with Captain Kirk stating in 2267 that humanity was on "a thousand planets and spreading out", while Captain Picard referred to the Federation (in 2373) as being made up of "over one hundred and fifty" planets, spread across 8,000 light-years. The Federation is a major galactic power, and at various times has been at war with other powers such as the Klingons, the Romulans and the Dominion. The Federation's space force is called Starfleet, and, although most of Star Trek depicts peaceful exploration of the galaxy, Starfleet is also capable of considerable military might. Section 31 is a paramilitary espionage agency, described by writer Ira Steven Behr as "…doing the nasty stuff that no one wants to think about.".The Federation is depicted as a democratic republic, led by a President based in Paris on Earth. Presidential powers include issuing pardons and declaring states of emergency. This president is supported by a cabinet. The Federation also has a supreme court and a legislature, the Federation Council, with delegates from its various member worlds. A constitution and a charter have both been referred to as founding documents of the Federation.
Several planets are shown to desire Federation membership. Joining the Federation is a complicated process, and requires meeting various criteria. Disqualifying criteria include caste-based discrimination and violations of sentient rights. A single, unified government is not required for admission, but is desirable. Most Starfleet personnel are Federation citizens. Non-citizens can join Starfleet, but the process is more difficult, as with all non-Federation races.
The Federation's counterpart in the Mirror Universe is the Terran Empire, a human-dominated authoritarian state which has formed an empire by conquest.

Future of the Federation
In the Short Treks episode "Calypso", taking place at an unknown time in the distant future, the character of Craft refers to the "V'draysh". Little is said about the V'draysh, except that it is at war with Alcor IV, and that the V'draysh people are searching for artifacts from ancient human history. The writer of this episode, Michael Chabon, stated that the name "V'draysh" is intended to be a syncope for the word "Federation".In the 32nd century setting of the third season of Star Trek: Discovery, the Federation had undergone a near-total collapse precipitated by "The Burn", a galaxy-wide disaster. This shrunk the Federation from a peak of 350 worlds to just 38, notably excluding both Earth and Ni'Var (formerly known as Vulcan). During the fourth season, the Federation is in the process of rebuilding itself; Starfleet Academy is reopened, new shipbuilding facilities are commissioned, and many former member worlds such as Trill, Ni'Var and Earth rejoin.

Non-canon references
In non-canon sources like the original 1975 Star Trek Star Fleet Technical Manual, Johnson's Worlds of the Federation, and roleplaying games, the Federation's five founding members were Earth (or Terra), Vulcan, Tellar, Andor, and Alpha Centauri. Some non-canon works assert that founding member Alpha Centauri is home to a human race (transplanted by the Preservers from classical third-century BC Greece) known as, variously, Centaurans, Centaurians, or Centauri.
The 1980-to-2188 historical guide Star Trek Spaceflight Chronology posits the Federation as being incorporated at 'the first Babel Interplanetary Conference' in 2087.
In books such as the Star Trek Star Fleet Technical Manual and the novel Articles of the Federation, the Federation's founding document is the Articles of Federation.

References
External links
United Federation of Planets at Memory Alpha