A flag is a piece of cloth flown from a pole or mast, usually intended for signaling or identification. Flags were initially created for signalling (as in semaphore), and for the identification of those who displayed them, and are still used for that purpose today. Flags are also used in messaging or advertising, or for decorative purposes, though at this less formal end the distinction between a flag and a simple cloth banner is blurred. Generally, a piece of cloth is a flag if it is flown like a flag, with one side attached, though many flags are recognisable if displayed in other forms.
The study of flags is known as vexillology, from the Latin vexillum meaning flag or banner.
Over time, people made the realization that the adornments were the more visible elements of a vexilloid. This was hastened by the development of sea travel, which called for a means of unambiguous identification over a great distance. Simple, brightly-colored designs which moved with the wind caught the eye best. Today, flags continue to be used to signal between ships or from ship to harbor. An example is an entirely yellow flag, which means that the ship's crew is quarantined for an infectious disease.
The use of flags to signal miltary orders or to rally troops continued until the late 19th century. Each military unit often had a unique unit flag which was often decorated with ribbons indicating battle honors, and it was considered a great honor to capture the enemies flag and a great shame to lose one's own. The practice of carrying flags into battle ended in the late 19th century when rifle fire became
accurate enough to make carrying a flag suicidal.
Another use of flags is in weather announcements. Ports and ships often fly flags indicating wind conditions at sea. A red flag with a black center square indicates a gale while two such flags indicate a hurricane. Beaches often post red, yellow or green flags to indicate safe or unsafe surf or ice conditions.
Especially before radio, ships at sea could send messages by sending letters flags up, spelling out words which could be read by the different colors and designs of each flag.
The full development of heraldry in about 1200 C.E. also brought sophistication to the development and design of flags. The oldest national flag continually in use is the aforementioned Dannebrog, which dates legendarily from 1219.
One of the most popular uses of a flag is to symbolize a nation or country. Some national flags have been particularly inspirational to other nations, countries, or subnational entities in the design of their own flags. Some prominent examples include:
The Union Flag of the United Kingdom, more commonly (and correctly, when used by warships at sea) called the "Union Jack". British colonies typically fly a flag based on one of the ensigns based on this flag, and many former colonies have retained the design to acknowledge their cultural history, show gratitude to the U.K., or possibly to reflect their participation in the Commonwealth. Examples: Australia, Fiji, New Zealand, and curiously Hawaii.
Ethiopia was seen as a model by emerging African states of the 1950's and 1960's, as it was one of the oldest continually independent states in Africa. Accordingly, its flag became the source of the Pan-African colours. Examples: Togo, Senegal, Ghana, Mali.
Flags are particularly important at sea, where they can mean the difference between life and death, and consequently where the rules and regulations for the flying of flags are strictly enforced. A national flag flown at sea is known as an ensign. A courteous, peaceable merchant ship or yacht customarily flies its ensign (in the usual ensign position) together with the flag of whatever nation it is currently visiting at the mast (known as a courtesy flag). To fly one's ensign alone in foreign water, a foreign port or in the face of a foreign warship traditionally indicates a willingness to fight, with cannon, for the right to do so. This custom is still (2004) taken quite seriously by many naval and port authorities and is readily enforced in many parts of the world by boarding, confiscation, and other civil penalties.
In some countries yacht ensigns are different from merchant ensigns in order to signal that the yacht is not carrying cargo that requires a customs declaration. Carrying commercial cargo on a boat with a yacht ensign is smuggling in many jurisdictions.
Unusual flag designs include the non-rectangular national flag of Nepal (vaguely in the shape of two stacked triangles) and the square flag of Switzerland. Also unusual are flags with a differing design on either side, as demonstrated by the national flag of Paraguay and state flag of Oregon in the U.S.
In American and Canadian football, referees use flags to indicate an error has been made in game play. The phrase used for such an indication is flag on the play. The flag itself is a small, weighted handkerchief, tossed on the field at the approximate point of the infraction; the intent is usually to sort out the details after the current play from scrimmage has concluded. In American football, the flag is usually yellow; in Canadian football, it is usually red.
In auto and motorcycle racing, flags are used to communicate with drivers. Most famously, a checkered flag of black and white indicates the end of the race, and victory for the leader. A yellow flag is used to indicate caution requiring slow speed and a red flag requires racers to immediately stop. A black flag is used to indicate penalties.
In Association football (soccer), assistant referees carry small flags along the touch lines. They use the flags to indicate to the referee potential infringements of the Laws or who is entitled to possession of the ball that has gone out of the field of play, or, most famously, raise the flag overhead to indicate an offside offence. Officials called touch judges use flags for similar purposes in both codes of rugby.
In addition, fans of almost all sports will wave flags in the stands to indicate their support for the participants. Many sports teams have their own flags, and in individual sports, fans will indicate their support for a player by waving the flag of his or her home country.