At the time of the Declaration of Independence in July 1776, the Continental Congress would not legally adopt flags with "stars, white in a blue field" for another year. The flag contemporaneously known as "the Continental Colors" has historically been referred to as the first national flag.

The Continental Navy raised the Colors as the ensign of the fledgling nation in the American War for Independence—likely with the expedient of transforming their previous British red ensigns by adding white stripes—and would use this flag until 1777, when it would form the basis for the subsequent de jure designs.

On June 14, 1777, the Second Continental Congress passed the Flag Resolution which stated: "Resolved, That the flag of the thirteen United States be thirteen stripes, alternate red and white; that the union be thirteen stars, white in a blue field, representing a new constellation." Flag Day is now observed on June 14 of each year.

The first official U.S. flag flown during battle was on August 3, 1777, at Fort Schuyler (Fort Stanwix) during the Siege of Fort Stanwix. Massachusetts reinforcements brought news of the adoption by Congress of the official flag to Fort Schuyler. Soldiers cut up their shirts to make the white stripes; scarlet material to form the red was secured from red flannel petticoats of officers' wives, while material for the blue union was secured from Capt. Abraham Swartwout's blue cloth coat. A voucher is extant that Capt. Swartwout of Dutchess County was paid by Congress for his coat for the flag.

Benjamin Franklin and John Adams, in a letter dated October 3, 1778, to Ferdinand I of the Two Sicilies, described the American flag as consisting of "13 stripes, alternately red, white, and blue, a small square in the upper angle, next the flag staff, is a blue field, with 13 white stars, denoting a new Constellation."

The 1777 resolution was most probably meant to define a naval ensign. In the late 18th century, the notion of a national flag did not yet exist, or was only nascent. The flag resolution appears between other resolutions from the Marine Committee. On May 10, 1779, Secretary of the Board of War Richard Peters expressed concern "it is not yet settled what is the Standard of the United States." However, the term "Standard" referred to a national standard for the Army of the United States. Each regiment was to carry the national standard in addition to its regimental standard. The national standard was not a reference to the national or naval flag.

On 10 May 1779, a letter from the War Board to George Washington stated that there was still no design established for a national standard, on which to base regimental standards, but also referenced flag requirements given to the board by General von Steuben.

On 3 September, Richard Peters submitted to Washington "Drafts of a Standard" and asked for his "Ideas of the Plan of the Standard," adding that the War Board preferred a design they viewed as "a variant for the Marine Flag." Washington agreed that he preferred "the standard, with the Union and Emblems in the centre". The drafts are lost to history, but is likely to be similar to the first Jack of the United States.

The origin of the stars and stripes design has been muddled by a story disseminated by the descendants of Betsy Ross. The apocryphal story credits Betsy Ross for sewing one of the first flags from a pencil sketch handed to her by George Washington. No evidence for this exists either in the diaries of George Washington nor in the records of the Continental Congress. Indeed, nearly a century passed before Ross's grandson, William Canby, first publicly suggested the story in 1870.

In 1795, the number of stars and stripes was increased from 13 to 15 (to reflect the entry of Vermont and Kentucky as states of the Union).

On April 4, 1818, a plan was passed by Congress at the suggestion of U.S. Naval Captain Samuel C. Reid in which the flag was changed to have 20 stars, with a new star to be added when each new state was admitted, but the number of stripes would be reduced to 13 so as to honor the original colonies.

The flag was changed to have 21 stars, with a new star to be added for Illinois.

The flag was changed to have 23 stars. (for Alabama and Maine)

The flag was changed to have 24 stars. (for Missouri)

The first recorded use of fringe on a flag dates from 1835, and the Army used it officially in 1895.

The flag was changed to have 27 stars. (for Florida)

The flag was changed to have 28 stars. (for Texas)

The flag was changed to have 29 stars. (for Iowa)

The flag was changed to have 30 stars. (for Wisconsin)

The flag was changed to have 31 stars. (for California)

The flag was changed to have 32 stars. (for Minnesota)

The flag was changed to have 33 stars. (for Oregon)

The flag was changed to have 34 stars. (for Kansas)

The flag was changed to have 35 stars. (for West Virginia)

The flag was changed to have 36 stars. (for Nevada)

The flag was changed to have 37 stars. (for Nebraska)

The flag was changed to have 38 stars. (for Colorado)

The flag was changed to have 43 stars. (for North Dakota, South Dakota, Montana, Washington, Idaho)

The flag was changed to have 44 stars. (for Wyoming)

The flag was changed to have 45 stars. (for Utah)

The flag was changed to have 46 stars. (for Oklahoma)

The flag was changed to have 48 stars. (for New Mexico, Arizona)

In 1907 Eben Appleton, New York stockbroker and grandson of Lieutenant Colonel George Armistead (the commander of Fort McHenry during the 1814 bombardment) loaned the Star Spangled Banner Flag to the Smithsonian Institution, and in 1912 he converted the loan to a gift. Appleton donated the flag with the wish that it would always be on view to the public.

The flag did not appear on U.S. postal stamp issues until the Battle of White Plains Issue was released in 1926, depicting the flag with a circle of 13 stars.

The flag was changed to have 25 stars. (for Arkansas)

The flag was changed to have 26 stars. (for Michigan)

The first U.S. postage stamp to feature the flag as the sole subject was issued July 4, 1957, Scott catalog number 1094.

The flag was changed to have 49 stars. (for Alaska)

The flag was changed to have 50 stars. (for Hawaii)

The basic design of the current flag is specified by 4 U.S.C. (Title 4 of the United States Code); outlines the addition of new stars to represent new states, with no distinction made for the shape, size, or arrangement of the stars. Specifications for federal government use adhere to the following values: Hoist (height) of the flag: A = 1.0 Fly (width) of the flag: B = 1.9 Hoist (height) of the canton ("union"): C = 0.5385 (A × 7/13, spanning seven stripes) Fly (width) of the canton: D = 0.76 (B × 2/5, two-fifths of the flag width) E = F = 0.0538 (C/10, One-tenth of the height of the canton) G = H = 0.0633 (D/12, One twelfth of the width of the canton) Diameter of star: K = 0.0616 (L × 4/5, four-fifths of the stripe width, the calculation only gives 0.0616 if L is first rounded to 0.077) Width of stripe: L = 0.0769 (A/13, One thirteenth of the flag height) These specifications are contained in an executive order which, strictly speaking, governs only flags made for or by the U.S. federal government. In practice, most U.S. national flags available for sale to the public have a different width-to-height ratio; common sizes are 2 × 3 ft. or 4 × 6 ft. (flag ratio 1.5), 2.5 × 4 ft. or 5 × 8 ft. (1.6), or 3 × 5 ft. or 6 × 10 ft. (1.667). Even flags flown over the U.S. Capitol for sale to the public through Representatives or Senators are provided in these sizes. Flags that are made to the prescribed 1.9 ratio are often referred to as "G-spec" (for "government specification") flags.

In 1994, the National Museum of American History determined that the Star Spangled Banner Flag required further conservation treatment to remain on public display. In 1998 teams of museum conservators, curators, and other specialists helped move the flag from its home in the Museum's Flag Hall into a new conservation laboratory.

On July 4, 2007, the 50-star flag became the version of the flag in longest use, surpassing the 48-star flag that was used from 1912 to 1959.

Following the reopening of the National Museum of American History on November 21, 2008, the flag is now on display in a special exhibition, "The Star-Spangled Banner: The Flag That Inspired the National Anthem" where it rests at a 10 degree angle in dim light for conservation purposes.

Potential statehood candidates include U.S. territories, the national capital (Washington, District of Columbia), or a state created from the partition of an existing state. Residents of the District of Columbia and Puerto Rico have each voted for statehood in referendums (most recently in the 2016 statehood referendum in the District of Columbia and the 2017 Puerto Rican status referendum.) Neither proposal has been approved by Congress.

In 2019, District of Columbia mayor Muriel Bowser had dozens of 51-star flags installed on Pennsylvania Avenue, the street linking the U.S. Capitol building with the White House, in anticipation of a hearing in the U.S. House of Representatives regarding potential District of Columbia statehood.