The rainbow flag (also known as the gay pride flag or LGBT pride flag) is a symbol of lesbian, gay, bisexual, transgender, and queer (LGBTQ) pride and LGBTQ social movements. Other older uses of rainbow flags include a symbol of peace. The colors reflect the diversity of the LGBTQ community, as the flag is often used as a symbol of gay pride during LGBTQ rights marches. While this use of the rainbow flag originated in San Francisco, it is now used worldwide.
Originally devised by artist Gilbert Baker, the design has undergone several revisions since its debut in 1978, first to remove colors then restore them based on availability of fabrics. The first flag had eight colors, however the traditional and still most common variant consists of six stripes: red, orange, yellow, green, blue, and violet. The flag is typically flown horizontally, with the red stripe on top, as it would be in a natural rainbow.
LGBTQ individuals and allies currently use rainbow flags and many rainbow-themed items and color schemes as an outward symbol of their identity or support. The rainbow flag is also commonly used as a general symbol of social equality and individuality. In addition to the rainbow, many other flags and symbols are used to communicate specific identities within the LGBTQ+ community.
Gilbert Baker, an openly gay activist born in 1951, grew up in Parsons, Kansas, and went on to serve in the US army for about two years around 1970. After an honorable discharge, Gilbert taught himself to sew. In 1974, Baker met Harvey Milk, an influential gay leader, who three years later challenged Baker to come up with a symbol of pride for the gay community. The original gay pride flag flew at the San Francisco Gay Freedom Day Parade celebration on June 25, 1978. Before this pride, the Pink triangle was used as a symbol for the LGBT Movement but it represented a dark chapter in the history of same-sex rights. The Pink triangle was created by the Nazis during World War II to identify and stigmatize homosexuals in the same way the Star of David was used against Jews and others regarded as viruses or sub-humans in the social fabric. It functioned as a Nazi tool of oppression. Harvey Milk and others did not want to use this symbol anymore, Artie Bressan, a close friend of Baker's, pressed on Baker for a new symbol and called it "the dawn of a new gay consciousness and freedom". It has been suggested that Baker may have been inspired by Judy Garland's singing "Over the Rainbow" and the Stonewall riots that happened a few days after Garland's death (she was one of the first gay icons).
Another suggestion for how the rainbow flag originated is that at college campuses during the 1960s, some people demonstrated for world peace by carrying a Flag of the Races (also called the Flag of the Human Race) with five horizontal stripes (from top to bottom they were red, white, brown, yellow, and black).
The first rainbow flags were commissioned by the fledgling pride committee and were produced by a team led by Baker that included artist Lynn Segerblom. Segerblom was then known as Faerie Argyle Rainbow; according to her, she created the original dyeing process for the flags. Baker is said to have gotten the idea for the rainbow flag from the Flag of the Races in borrowing it from the Hippie movement of that time largely influenced by pioneering gay activist Allen Ginsberg. The flag originally comprised eight stripes; Baker assigned specific meaning to each of the colors: Thirty volunteers hand-dyed and stitched the first two flags for the parade.
After the assassination of gay San Francisco City Supervisor Harvey Milk on November 27, 1978, demand for the rainbow flag greatly increased. To meet demand, the Paramount Flag Company began selling a version of the flag using stock rainbow fabric with seven stripes using the colors red, orange, yellow, green, turquoise, blue, and violet. As Baker ramped up production of his version of the flag, he too dropped the hot pink stripe because of the unavailability of hot-pink fabric. San Francisco-based Paramount Flag Co. also began selling a surplus stock of Rainbow Girls flags from its retail store on the southwest corner of Polk and Post, at which Gilbert Baker was an employee.
In 1979, the flag was modified again. The organizers of the 1979 San Francisco parade decided to split the flag into two in order to decorate the two sides of the parade route. To achieve this, they needed an even number of stripes, so the turquoise stripe was dropped, which resulted in a six stripe version of the flag -- red, orange, yellow, green, blue, and violet.
In 1989, the rainbow flag came to further nationwide attention in the U.S. after John Stout sued his landlords and won when they attempted to prohibit him from displaying the flag from his West Hollywood, California, apartment balcony.
In 2000, the University of Hawaii at Manoa changed its sports teams' name from "Rainbow Warriors" to "Warriors" and redesigned its logo to eliminate a rainbow from it. Initially Athletic Director Hugh Yoshida said that the change was to distance the school's athletic program from homosexuality. When this drew criticism, Yoshida then said the change was merely to avoid brand confusion. The school then allowed each team to select its own name, leading to a mix including "Rainbow Warriors", "Warriors", "Rainbows" and "Rainbow Wahine". This decision was reversed in February 2013, when current athletic director Ben Jay forced all men's athletic teams to be nicknamed "Warriors" and all women's teams "Rainbow Warriors", and again in May 2013 when all teams were once again called "Rainbow Warriors" regardless of sex.
The rainbow flag celebrated its 25th anniversary in 2003. During the gay pride celebrations in June of that year, Gilbert Baker restored the rainbow flag back to its original eight-striped version and advocated that others do the same. He later unveiled his final version with nine-stripes for the 39th anniversary of the first rainbow flag. Reportedly in response to Donald Trump's election, Baker added a ninth stripe in lavender (above the hot pink stripe at the top) to represent diversity. However, much of the wider gay community has continued to use the better known six-striped version.
In autumn 2004 several gay businesses in London were ordered by Westminster City Council to remove the rainbow flag from their premises, as its display required planning permission. When one shop applied for permission, the Planning sub-committee refused the application on the chair's casting vote (May 19, 2005), a decision condemned by gay councillors in Westminster and the then Mayor of London, Ken Livingstone. In November the council announced a reversal of policy, stating that most shops and bars would be allowed to fly the rainbow flag without planning permission.
In June 2004 LGBT activists sailed to Australia's uninhabited Coral Sea Islands Territory and raised the rainbow flag, proclaiming the territory independent of Australia, calling it the Gay and Lesbian Kingdom of the Coral Sea Islands in protest to the Australian government's refusal to recognise same-sex marriages. The rainbow flag is the official flag of the kingdom.
On June 26, 2015, the White House was illuminated in the rainbow flag colors to commemorate the legalization of same-sex marriages in all 50 U.S. states, following the Obergefell v. Hodges Supreme Court decision.
The rainbow flag has found wide application on all manner of products. The rainbow flag colors are routinely used as a show of LGBT identity and solidarity. The rainbow colors have become so widely recognized as a symbol of LGBT pride and identity that they have effectively replaced most other LGBT symbols, including the Greek letter lambda and the pink triangle. One common item of jewelry is the pride necklace or freedom rings, consisting of six rings, one of each color, on a chain. Other variants range from key chains to candles. In Montreal, the entrance to Beaudry metro station, which serves that city's Gay Village, was rebuilt in 1999 with rainbow-colored elements integrated into its design.
In Poland, some activists have been charged with crimes such as "offending religious feelings" and "insulting a monument" for use of rainbow flags and symbols. In response, there is a slogan "T?cza nie obra?a" (The rainbow does not offend).
Many variations of the rainbow flag have been used. Some of the more common ones include the Greek letter lambda (lower case) in white in the middle of the flag and a pink triangle or black triangle in the upper left corner. Other colors have been added, such as a black stripe symbolizing those community members lost to AIDS. The rainbow colors have also often been used in gay alterations of national and regional flags, replacing for example the red and white stripes of the flag of the United States. In 2007, the Pride Family Flag was unveiled at the Houston, Texas pride parade.
In the early years of the AIDS pandemic, activists designed a "Victory over AIDS" flag consisting of the standard six-stripe rainbow flag with a black stripe across the bottom. Leonard Matlovich, himself dying of AIDS-related illness, suggested that upon a cure for AIDS being discovered, the black stripes be removed from the flags and burned.
LGBTQ communities in other countries have adopted the rainbow flag. A South African gay pride flag which is a hybrid of the rainbow flag and the national flag of South Africa was launched in Cape Town in 2010. Flag designer Eugene Brockman said "I truly believe we (the LGBT community) put the dazzle into our rainbow nation and this flag is a symbol of just that."
In March 2017, Gilbert Baker created a 9-stripe version of his original 1977 flag, with lavender, pink, turquoise and indigo stripes along with the red, orange, yellow, green and violet. According to Baker, the lavender stripe symbolizes diversity. 
In June 2017, the city of Philadelphia adopted a revised version of the flag designed by the marketing firm Tierney that adds black and brown stripes to the top of the standard six-color flag, to draw attention to issues of people of color within the LGBTQ community. LGBTQ activists in Philadelphia and other communities criticized the variation as unnecessary and divisive.
On February 12, 2018, during the street carnival of São Paulo, thousands of people attended a parade called Love Fest, which celebrated human diversity, sexual and gender equality. A version of the flag, created by Estêvão Romane, co-founder of the festival, was unveiled which presented the original eight stripe flag with a white stripe in the middle, representing all colors (human diversity in terms of religion, gender, sex preferences, ethnicities), and peace and union among all.
In June 2018 designer Daniel Quasar released a redesign incorporating elements from both the Philadelphia flag and trans pride flag to bring focus on inclusion and progress within the community. The flag design immediately went viral on social media, prompting worldwide coverage in news outlets. While retaining the common six-stripe rainbow design as a base, the "Progress" variation adds a chevron along the hoist that features black, brown, light blue, pink, and white stripes to bring those communities (marginalized people of color, trans individuals, and those living with HIV/AIDS and those who have been lost) to the forefront; "the arrow points to the right to show forward movement, while being along the left edge shows that progress still needs to be made." 
In July 2018 the Social Justice Pride Flag was released in Chennai, India in the Chennai Queer LitFest inspired by the other variations of the Pride flag around the world. The flag was designed by Chennai-based gay activist Moulee. The design incorporated elements representing Self-Respect Movement, anti-caste movement and leftist ideology in its design. While retaining the original six stripes of the rainbow flag, the Social Justice Pride Flag incorporates black representing the self-respect movement, blue representing Ambedkarite movement and red representing left values.
In 2018, marchers at the Equality March in Cz?stochowa carried a modified version of the flag of Poland in rainbow colors. They were reported to prosecutors for desecration of national symbols of Poland, but the prosecutors determined that no crime had been committed.
For the 25th anniversary of the Stonewall Riots in 1994, flag creator Baker, aka Sister Chanel 2001 of the Sisters of Perpetual Indulgence, was commissioned to create the world's largest rainbow flag. The mile-long flag, dubbed "Raise the Rainbow", took months of planning and teams of volunteers to coordinate every aspect. The flag utilized the basic six colors and measured 30 feet (9.1 m) wide. After the march, foot-wide (0.30 m) sections of the flag were given to individual sponsors after the event had ended. Additional large sections of the flag were sent with activists and used in pride parades and LGBTQ marches worldwide. One large section was later taken to Shanghai Pride in 2014 by a small contingent of San Francisco Sisters of Perpetual Indulgence, and documented in the film "Stilettos For Shanghai". The Guinness Book of World Records confirmed it as the world's largest flag.
In 2003 Baker was again commissioned to produce a giant flag marking the 25th anniversary of the flag itself. Dubbed "25Rainbow Sea to Sea," the project entailed Baker again working with teams of volunteers but this flag utilized the original eight colors and measured one and a quarter miles (2 km) across Key West, Florida, from the Atlantic Ocean to the Gulf of Mexico. The flag was again divided afterwards and sections were sent to over a hundred cities worldwide.
The largest rainbow flag in the Southern Hemisphere is a six-stripe one first flown to mark the fourth Nelson Mandela Bay (NMB) Pride in 2014, held in the Eastern Cape province city of South Africa, Port Elizabeth. It measures twelve by eight meters (39 by 26 ft), and flies on the country's tallest flag pole, which is sixty meters (200 ft) high, and is in Donkin Reserve, in Port Elizabeth's central business district. NMB Pride had the flag manufactured, in part, as a symbol for LGBTQ youth to feel empowered even if they were not able to come out. On the decision to fly the flag, a spokesperson for the municipality said, NMB "officially adds its voice to governments committing, firstly, to recognizing the LGBTQ community, and most importantly, to uphold the rights of the LGBTQ community". It is regularly flown for NMB Pride as well as March 21 which is Human Rights Day in South Africa, and International Day for the Elimination of Racial Discrimination, both commemorating the 1960 Sharpeville massacre.
On June 1, 2018, Venice Pride in California flew the world's largest free-flying flag to launch United We Pride. After its debut for Venice Pride, the flag travelled to San Francisco at the end of the month for SF Pride and the fortieth anniversary of the rainbow flag's adoption. United We Pride then had the flag sent to Paris, London, Berlin, Vancouver, Sydney, Miami, and Tokyo, ending in New York City for Stonewall 50 - WorldPride NYC 2019. The giant flag was produced by the flag originator Gilbert Baker, and measures 131 square metres (1,410 sq ft).
In June 2019, to coincide with fifty-year anniversary of the Stonewall Riots, steps at the Franklin D. Roosevelt Four Freedoms Park were turned into the largest LGBTQ pride flag. The rainbow-decorated 12-by-100-foot (3.7 m × 30.5 m) staircase Ascend With Pride was installed June 14-30.
The popularity of the rainbow flag has influenced the creation and adoption of a wide variety of multi-color multi-striped flags used to communicate specific identities within the LGBTQ+ community, including the bisexual pride flag, pansexual pride flag, and transgender pride flags.
Spirit Day, an annual LGBTQ+ awareness day since 2010, takes its name from the violet stripe representing "spirit" on the rainbow flag. Participants wear purple to show support for LGBTQ+ youth who are victims of bullying.
It's a flag, it needed to have depth, and so I liked the idea that each color would represent an element of everyone's life.