Since Starfleet was formed before the Federation was founded, it was initially a purely Terran organization. As such, it borrowed many conventions from Earth's naval history, most significantly its system of ranks.
The earliest Starfleet uniforms, circa 2150, were likewise based on Terran navy uniforms. They were designed for comfort and durability, because the first Starfleet ships were away from Earth for long periods of time. These uniforms were a predominantly dark blue jumpsuit, complete with zippered pockets, worn over a black undershirt. Most officers left the top zipper partially undone for added breathing room.
The uniforms had colored accents at the shoulders, in the form of a stripe, on both the front and back, that went from the top of the shoulder near the neck, down several centimeters to a right angle, then out to the outside of the arm. The color of the stripe corresponded to the officer's department: gold for command, red for services, and teal for sciences. Just inside the right angle formed by the front right stripe appeared the officer's rank insignia. The insignia consisted of small rectangular pips -- ranging from four for Captains down to one for Ensigns.
Admirals' uniforms of the time were similar in appearance. They were black instead of blue, and the uniforms were two-piece instead of jumpsuits. Admirals normally wore a collared shirt and a necktie underneath.
By about 2260, Starfleet had adopted a very different style. The standard duty uniform consisted of black trousers with a loose solid-color top. The colors of these ribbed-collar shirts -- gold, orange, or teal -- had the same meanings as the colors of the stripes on the earlier uniforms (with orange substituted for red). Each uniform had a single gold band on each sleeve. Interestingly, the female duty uniforms were slightly different, having a larger and looser (indeed, more feminine) collar than the male uniforms.
The uniforms showed no rank insignia, oddly, but they did have an interesting addition. On the right breast of the uniform shirt was a ship insignia. Each ship had its own shape, almost like a mission patch; the shapes were gold with black borders. Inside every insignia was a black symbol corresponding to the officer's department -- command, services, sciences (and sometimes a red cross for medical).
By 2266, Starfleet made some more mofifications. The uniform shirts were made more lightweight, with a simple small black collar and no gold band on the sleeve. Red was once again the color used for services personnel, instead of orange. Rank insignia were added to the sleeves, in the form of gold braids. The braids ranged from two-and-a-half for Captains down to none for Ensigns. The uniforms retained the ship-specific chest insignia.
The female duty uniform changed significantly, however. Their shirts were lengthened to skirt-length, and pants were replaced by stockings. The neckline was also wider -- and lower -- than on the male uniforms. After making these changes, Starfleet was rocked by accusations of sexism, particularly after such a long history of gender neutrality, but the uniforms stayed.
By 2272 or so, uniforms had changed once again. The style this time involved smooth, clean lines and neutral colors. Historical observers have made several attempts to figure out what the Quartermaster was thinking, in vain. Most perplexing is a small unit found on the front of the uniforms at the waist, its function unknown.
The only significant development of these short-lived designs was that the ship-specific insignia for the U.S.S. Enterprise -- which looks somewhat like an arrowhead but is actually a diagram showing the relationship between energy and speed under both normal and warp-field circumstances -- was adopted as the symbol of Starfleet and used on all uniforms (usually with embellishments).
Around 2280, Starfleet introduced its most successful uniform designs ever. These uniforms, with only minor changes, survived until the middle of the next century. They abandoned nearly every previous Starfleet uniform convention. The uniforms used black pants with heavy dark red jackets over red-and-black vests and colored shirts (somewhat similar to the 2260-era shirts in style). Only the color of the undershirt (with only the collar normally visible) changed according to department, and Starfleet added to the list of possible colors by subdividing the department list. A strap on the right shoulder kept the jacket closed, and its color matched the color of the undershirt.
Said strap also held the rank insignia, completely redesigned from previous versions. The insignia on the left breast was the standard Starfleet insignia (the arrowhead symbol with a circle underneath) on top of a horizontal bar. Female duty uniforms were once again basically the same as the male uniforms, although skirted versions were available as an option.
In 2345, the chest insignia was changed to a solid silver arrowhead on a gold oval, and communicators were incorporated into the piece. That was the only major change to the uniform until 2350.
In 2350, Starfleet completely overhauled their uniforms once again. Returning to older conventions, the new uniform was a single-piece jumpsuit, predominately black, but with large fields of color on the chest and on the back. Same-colored stripes adorned the shoulders. The colors were similar to those used since the early days of Starfleet, but with Command and Services oddly reversed (Red: Command, Gold: Services, Teal: Sciences).
These uniforms had no collar to speak of, and the women wore the same basic design as men. Rank insignia were similar to those of the 2150 era, only round rather than rectangular, and located on the right side of the neck opening. A variant design, popular only briefly, was a unisex skort worn over bare legs.
In 2366, the same basic designs were used, but the style was changed. The new uniforms had a tight collar (onto which the rank pips were moved) and were usually two-piece (although junior officers and enlisted crew often wore jumpsuit versions). They also eliminated the stripes from the shoulders.
2369 saw the introduction of an alternate jumpsuit/fatigue uniform, used extensively on the Federation Deep Space stations. These uniforms used black pants and black-and-color overshirts with gray undershirts. The overshirts were mostly black, with the shoulders solid-colored according to department. These uniforms were more durable and comfortable for working in more hostile environments. Rank insignia were placed on the undershirt collar. The overshirts had a V-neck which different officers closed to different heights, particularly on starships, depending on their preferences on decorum vs. comfort.
In 2371, all Starfleet officers were given the option of wearing either the standard uniforms or the new jumpsuits. This resulted in an odd mixture of uniforms aboard many starships. Some captains required their crew to all use one or the other. In addition, the Starfleet insignia was changed to use a gold trapezoid behind the arrowhead.
By 2373, this had been abandoned and Starfleet created their newest design. Once again, black pants are part of the ensemble. The overshirts are black with gray shoulders, with undershirts colored by department. Rank insignia are still placed on the undershirt collar. The sleeves have a single stripe, colored by department.
Several Starfleet officers have reported eerily similar uniforms being worn by Starfleet personnel during time travel situations into the future. Captains Jean-Luc Picard and Benjamin Sisko are among those who have reported seeing these uniforms. They have black pants (as usual) with shirts colored by department. A black stripe delineates the shoulder area, but the shoulders are colored the same as the rest of the shirt. The Starfleet insignia has, in these cases, been changed to a hollow arrowhead with two vertical gold bars behind it.
The history of Starfleet uniforms is a long and varied one. But whatever form they take, millions of Federation citizens -- and even some non-citizens -- aspire to wear them, because of the long tradition of excellence they represent.