A flag is a piece of fabric (most often rectangular or quadrilateral) with a distinctive design that is used as a symbol, as a signaling device, or as decoration. The term flag is also used to refer to the graphic design employed, and flags have since evolved into a general tool for rudimentary signalling and identification, especially in environments where communication is similarly challenging (such as the maritime environment where semaphore is used). National flags are patriotic symbols with varied wide-ranging interpretations, often including strong military associations due to their original and ongoing military uses. Flags are also used in messaging, advertising, or for other decorative purposes. The study of flags is known as vexillology, from the Latin word vexillum, meaning flag or banner.
Due to the use of flags by military units, 'flag' is also used as the name of some military units. A flag (Arabic: لواء) is equivalent to a brigade in Arab countries, and in Spain, a flag (Spanish: bandera) is a battalion-equivalent in the Spanish Legion.
In antiquity, field signs or standards were used in warfare that can be categorized as vexilloid or 'flag-like'. 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, or the dragon standard of the Sarmatians; the latter was let fly freely in the wind, carried by a horseman, but judging from depictions it was more similar to an elongated dragon kite than to a simple flag.