Flag of the Federation
The Flag of the United Federation of Planets was a patriotic banner that consisted of a blue background with a white seal of the Federation above the words "UNITED FEDERATION of PLANETS."

After viewing the video presentation on the Genesis Device aboard Kruge's Bird-of-Prey in 2285, Maltz was impressed with the devices ability to "make planets". Kruge, who believed it instead to be a great weapon, however mocked the presentation, refusing to believe that the whole project was as wholesome as was presented, stating, "Oh yes, ...new cities, homes in the country, ...your woman at your side, children playing at your feet. And overhead, fluttering in the breeze, the Flag of the Federation. Charming." ()

Though Ni'Var had left the Federation by the late 32nd century, President of Ni'Var T'Rina indicated that she believed Ni'Var and the Federation to be more than trusted allies, and that she hoped Ni'Var would soon be united "under the flag of the Federation" again. ()

Traditions 

The Flag of the Federation was often draped over the photon torpedo caskets of fallen Starfleet officers. (; ;  ; )

In the 23rd century,  starships such as the  sometimes displayed the flag in their briefing rooms. ()

The flag was also present at Starfleet courts martial, such as the one for the Nova Squadron in 2368. ()

It was also displayed in Deep Space 9's briefing room during various official ceremonies, such as Worf's court martial, and the induction ceremony when Bajor (almost) joined the Federation. ()

In accordance with an old Earth tradition, the flag was flown at a baseball game on the holosuite on Deep Space 9 when the Niners and the Logicians played a game in 2375. They also played the Anthem of the United Federation of Planets, taking their hats off and facing the flag. ()

By 3188, only a commissioned officer could raise the flag of the Federation. ()

Variations of the Federation Flag and Emblem

Federation pennant 

From at least 2268 until at least 2375 this emblem was used on pennants, Starfleet installations and official documents of the Federation. (, , )

Appendices

Background information 
The first "Flag of the Federation" in Star Trek was visible across Spock's coffin in . As it hadn't been designed yet, the flag was missing from the s conference room throughout The Original Series. An alternate Federation flag with yellow, orange, green and teal colors was seen in  at the Khitomer Conference.  

According to the Star Trek Sticker Book (Pg. 9), by Michael Okuda, "At one time, it was thought that the three bright stars in the starfield might represent Earth, , and the Klingon Homeworld, since during early episodes of  it was thought that the Klingons might have actually joined the Federation. When later episodes made it clear they had not, the three bright stars were left undefined."

Okuda later recalled, "Someone asked me if the 3 stars big stars on the UFP logo represented the founding members. But when I designed the symbol, Trek had not yet established the founding members. I did think that the three stars might represent core values: perhaps equality, compassion, & knowledge." 

As described in Star Trek: Action!, in Deep Space Nine "Tears of the Prophets", someone was looking at the photon torpedo prop and couldn't quite put their finger on what was missing. They then disappeared, and came back with the Flag of the Federation to drape over it.

External links 
 
 
 
Federation
Symbols