A flag is usually a piece of fabric with a distinctive design that is usually rectangular and used as a symbol, as a signaling device, or decoration. The term flag is also used to refer to the graphic design employed by a flag, or to its depiction in another medium.
The first flags were used to assist military coordination on battlefields, 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 potent 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 vexillum meaning flag or banner.