The NOAA flag has a long history, going back to at least 1899 with the U.S. Coast and Geodetic Survey flag. Although some aspects of the flag have been altered and additional flags have joined it, the main elements remain unchanged since then.

Left: The USC&GS Schooner Matchless "Fully Dressed" with all available flags to honor Memorial Day, 1909.; Right: Flags being flown aboard USC&GS Steamer Isis, 1916. The flag on the mainmast is for the Secretary of Commerce, indicating that he was aboard the vessel. (Image credit: NOAA)
U.S. Coast Survey flag, 1850

This 1850 sketch by surveyor Alexander Wadsworth Longfellow of the U.S. Coast Survey illustrates a humorous scene of a survey party relaxing at Richmond Island, Maine.
It is unknown if the U.S. Coast Survey flag depicted is an actual flag used by the agency or a product of Longfellow’s imagination.
Proposed U.S. Coast & Geodetic Survey flags, 1898

In 1898, ten flag designs were proposed for the U.S. Coast and Geodetic Survey (USC&GS). These are three designs created by USC&GS employee Sophie S. Hein.
U.S. Coast & Geodetic Survey flags, 1899

The first official flag of the USC&GS was adopted in 1899. This page from the 1898-1899 USC&GS service report shows the flags in use at the time. The triangle in the center of the flag symbolizes triangulation in surveying.
Ensign: The US national flag flown aboard a government ship is known as an ensign.
Service Flag: This is a special flag that identifies the service the ship belongs to.
Service Pennants (Commissioning Pennants): These long, narrow pennants indicate that the ship is a USC&GS vessel in commissioned status.
Superintendent’s Flag: This flag is only flown when the head of the USC&GS is aboard ship.
Secretary of the Treasury’s Flag: This flag is only flown when the Secretary of the Treasury is aboard ship. The USC&GS was under the Treasury Department until 1903.
U.S. Coast & Geodetic Survey flags, 1925
This flag illustration from a 1925 USC&GS banquet menu shows that the service flag is unchanged but the triangle on the earlier Superintendent’s Flag has been changed from a red right-pointing isosceles triangle to a white equilateral triangle, with the point upright, on the newly titled Director’s Flag.
New U.S. Coast & Geodetic Survey Director’s flag, c. 1934

By 1934 a new version of the Director’s Flag had been introduced. The flag is Old Glory blue with a white equilateral triangle, and two white stars, one at each side. The addition of the stars indicating the rank of rear admiral is based upon the flags used by U.S. Navy flag officers.
This flag design is now used by the Director of the NOAA Corps.
Environmental Science Services Administration Service flag

The flag used by the Environmental Science Services Administration (ESSA), which existed from 1965 to 1970, kept the design of the USC&GS flag but added a stylized globe of the earth on a blue disc to the center of the flag.
NOAA Flag (and Administrator flag), 1970 to current day

The National Oceanic and Atmospheric Administration (NOAA) was founded in 1970. In a nod to history, NOAA retained the 1899 USC&GS flag, adding the new NOAA logo, a flying seagull bisecting a circle into upper dark blue and lower light blue sections, to the center of the old design.

The NOAA Administrator’s personal flag, which is the NOAA flag with the addition of a white star in each of the four corners, can be used in office spaces as well as aboard NOAA ships when the Administrator is aboard.
NOAA Commissioned Corps flag, 2002

On March 7, 2002, Secretary of Commerce Donald L. Evans authorized a new flag for the NOAA Commissioned Officer Corps. Until then, the NOAA Corps had been the only member of the uniformed services without a distinctive flag of its own. On the flag, the NOAA Corps insignia appears within a red triangle, set within a white circle, against a navy blue background.
This flag represents NOAA's commissioned officer corps as a uniformed service, as opposed to NOAA itself as an agency, which includes both commissioned and civilian personnel. Like the similar flags of the other uniformed services, it is used for ceremonial purposes and indoor display, not flown from a fixed pole or aboard ship.
Today

NOAA’s flag represents our long history of service to the United States and the world. Today, it remains a symbol of NOAA’s commitment to science, service, and stewardship.