A flag is a piece of fabric (most often rectangular) with distinctive colours and design, often flown from a pole and used for symbolic, signalling, or decorative purposes. The term flag is also used to refer to the graphic design employed on such pieces of fabric. The study of flags is known as "vexillology" from the Latin , meaning "flag" or "banner".

The first flags were used to aid military coordination on the battlefield, and flags have since evolved into a common tool for basic signalling and identification, especially in environments where communication is challenging (such as maritime environments where semaphore is used). The national flag is a common patriotic symbol of a country, and many national or other flags may be assigned to flag families based on similarities in their designs that demonstrate a shared history, culture, or influence. Flags are also used in messages, advertising, or for other decorative purposes.

History

The origin of the flag is unknownInglefield, p. 39. and it remains unclear when the first flag was raised. Ships with vexilloids were represented on predynastic Egyptian pottery . In antiquity, field signs that can be categorised as vexilloid or "flag-like" were used in warfare, originating in ancient Egypt or Assyria.Flag | heraldry . Encyclopædia Britannica. Retrieved February 15, 2019. Examples include the Sassanid battle standard Derafsh Kaviani, and the standards of the Roman legions such as the eagle of Augustus Caesar's Xth legion and the dragon standard of the Sarmatians; the latter was allowed to fly freely in the wind, carried by a horseman, but depictions suggest that it bore more similarity to an elongated dragon kite than to a simple flag.

While the origin of the flag remains a mystery, the oldest flag discovered is made of bronze: a Derafsh or 'flag-like' Shahdad, which was found in Shahdad in Iran, and dates back to . It features a seated man and a kneeling woman facing each other, with a star in between. This iconography was found in other Iranian Bronze Age pieces of art.

Flags made of cloth were almost certainly the invention of the ancient peoples of the Indian subcontinent or the Zhou dynasty of Ancient China. Chinese flags had iconography such as a red bird, a white tiger, or a blue dragon, and royal flags were to be treated with a level of respect similar to that given to the ruler. Indian flags were often triangular and decorated with attachments such as a yak's tail and the state umbrella. Silk flags either spread to the Near East from China or it was just the silk itself, later fashioned by people who had independently conceptualised a rectangular cloth attached to a pole. They are often mentioned in the early history of Islam and may have been copied from India.

European flags are an independent invention. In the Roman world, the vexillum was a cloth military flag: Schmöger describes it as the only Roman cloth flag, used as a cavalry flag, detachment flag, signal flag, imperial standard, religious flag and provincial symbol, and as "the root of the modern European flag tradition". The Christian Roman labarum, first used by Constantine in the 4th century, was a version of the vexillum; although usually suspended from a horizontal bar, it was also sometimes displayed by fastening one side to the staff.

In medieval Europe, flags developed in connection with warfare, Christianity, heraldry, monarchy, cities, guilds and maritime identification. Heraldic flags included pennons, banners, standards, royal standards, ensigns, military standards and colours; in English heraldic usage, pennons were personal lance flags, banners bore the arms of the owner, and standards displayed livery colours and badges. Modern national flags, in the strict political sense, are associated with early modern and modern state formation, citizenship, revolution and nationalism; Elgenius describes national flags as markers of nation-building in the modern period, especially after the political changes associated with 1789.

During the peak of the sailing age, beginning in the early 17th century, it was customary (and later a legal requirement) for ships to fly flags designating their nationality;Articles 90–94 of the UN Convention on the Law of the Sea these flags eventually evolved into the national flags and maritime flags of today. Flags also became the preferred means of communications at sea, resulting in various systems of flag signals; see, International maritime signal flags.

Use of flags beyond a military or naval context began with the rise of nationalism by the end of the 18th century, although some flags date back earlier. The flags of countries such as Austria, Denmark or Turkey have legendary origins while many others, including those of Poland and Switzerland, grew out of the heraldic emblems of the Middle Ages. The 17th century saw the birth of several national flags through revolutionary struggle. One of these was the flag of the Netherlands, which appeared during the 80-year Dutch rebellion which began in 1568 against Spanish domination.Inglefield, p. 48.

Political change and social reform, allied with a growing sense of nationhood among ordinary people, led to the creation of new nations and flags all over the world in the 19th and 20th centuries.Inglefield, p. 50.

National flags

One of the most popular uses of a flag is to symbolise 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 flag of Denmark, the Dannebrog, is attested in 1478, and is the oldest national flag still in use. It inspired the cross design of the other Nordic countries: Sweden, Norway, Finland, Iceland, and several regional Scandinavian flags, including the Faroe Islands and Åland, as well as flags for the non-Scandinavian Shetland and Orkney.National Flag -The official website of Denmark . Earlier use of the white cross on red is attested by an armorial (Netherlands) of 1370-1386. In later monastic tradition, the Dannebrog made its first, miraculous appearance at the Battle of Lindanise on 15 June 1219. The flag of the Netherlands is the oldest tricolour. Its three colours of red, white and blue go back to Charlemagne's time, the ninth century. The coastal region of what today is the Netherlands was then known for its cloth in these colours. Maps from the early 16th century already put flags in these colours next to this region, like Texeira's map of 1520. A century before that, during the 15th century, the three colours were mentioned as the coastal signals for this area, with the three bands straight or diagonal, single or doubled. As state flag it first appeared around 1572 as the Prince's Flag in orange–white–blue. Soon the more famous red–white–blue began appearing, becoming the prevalent version from around 1630. Orange made a comeback during the civil war of the late 18th century, signifying the orangist or pro-stadtholder party. During World War II the pro-Nazi NSB used it. Any symbolism has been added later to the three colours, although the orange comes from the House of Orange-Nassau. This use of orange comes from Nassau, which today uses orange-blue, not from Orange, which today uses red-blue. However, the usual way to show the link with the House of Orange-Nassau is the orange pennant above the red-white-blue. It is said that the Dutch Tricolour has inspired many flags but most notably those of Russia, New York City, and South Africa (the 1928–94 flag as well the current flag). As the probable inspiration for the Russian flag, it is the source too for the pan-Slavic colours red, white and blue, adopted by many Slavic states and peoples as their symbols; examples are Slovakia, Serbia, and Slovenia. The national flag of France was designed in 1794. As a forerunner of revolution, France's tricolour flag style has been adopted by other nations. Examples: Italy, Belgium, Ireland, Romania and Mexico. The Union Flag (Union Jack) of the United Kingdom is the most commonly used. British colonies typically flew 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. Examples: Australia, Fiji, New Zealand, Tuvalu, and also the Canadian provinces of Manitoba, Ontario and British Columbia, and the American state of Hawaii; see commons:Flags based on British ensigns. The flag of the United States is nicknamed The Stars and Stripes or Old Glory. Some nations imitated this flag to symbolise their similarity to the United States or the American Revolution. Examples: Liberia, Chile, Taiwan (ROC), and the French region of Brittany.

Ethiopia was seen as a model by emerging African states of the 1950s and 1960s, as it was one of the oldest independent states in Africa. Accordingly, its flag became the source of the Pan-African colours, or 'Rasta colours'. Examples: Benin, Togo, Senegal, Ghana, Mali, Guinea. The flag of Turkey, which is very similar to the last flag of the old Ottoman Empire, has been an inspiration for the flag designs of many other Muslim nations. During the time of the Ottomans the crescent began to be associated with Islam and this is reflected on the flags of Algeria, Azerbaijan, Comoros, Libya, Mauritania, Pakistan, Tunisia and Maldives.Cyril Glassé, The New Encyclopedia of Islam (revised ed. 2001), s.v. "Moon" (p. 314). The Pan-Arab colours, green, white, red and black, are derived from the flag of the Great Arab Revolt as seen on the flags of Jordan, Libya, Kuwait, Sudan, Syria, the United Arab Emirates, Western Sahara, Egypt, Iraq, Yemen and Palestine. The Soviet flag, with its golden symbols of the hammer and sickle on a red field, was an inspiration to flags of other communist states, such as East Germany, China, Vietnam, Angola, Afghanistan (1978–1980) and Mozambique. The flag of Venezuela, created by Francisco de Miranda to represent the independence movement in Venezuela that later gave birth to the Gran Colombia, inspired the flags of Colombia, Ecuador, and the Federal Territories in Malaysia, all sharing three bands of yellow, blue and red with the flag of Venezuela. The flag of Argentina, created by Manuel Belgrano during the war of independence, was the inspiration for the United Provinces of Central America's flag, which in turn was the origin for the flags of Guatemala, Honduras, El Salvador, and Nicaragua.

National flag designs are often used to signify nationality in other forms, such as flag patches.

Civil flags

A civil flag is a version of the national flag that is flown by civilians on non-government installations or craft. The use of civil flags was more common in the past, in order to denote buildings or ships that were not crewed by the military. In some countries the civil flag is the same as the war flag or state flag, but without the coat of arms, such as in the case of Spain, and in others it is an alteration of the war flag.

War flags

Several countries, including the Royal Air Force, British Army and the Royal Navy (White Ensign) of the United Kingdom and the Soviet Union have had unique flags flown by their armed forces separately, rather than the national flag.

Other countries' armed forces (such as those of the United States or Switzerland) use their standard national flag; in addition, the U.S. has alongside flags and seals designed from long tradition for each of its six uniformed military services/military sub-departments in the Department of Defense and the Department of Homeland Security. The Philippines' armed forces may use their standard national flag, but during times of war the flag is turned upside down. Bulgaria's flag is also turned upside down during times of war. These are also considered war flags, though the terminology only applies to the flag's military usage.