The phalanx (: phalanxes or phalanges) was a rectangular mass military formation, usually composed entirely of heavy infantry armed with spears, pikes, sarissas, or similar pole weapons. The term is particularly used to describe the use of this formation in ancient Greek warfare, although the ancient Greek writers used it to also describe any massed infantry formation, regardless of its equipment. Arrian uses the term in his Array against the Alans when he refers to his legions. In Greek texts, the phalanx may be deployed for battle, on the march, or even camped, thus describing the mass of infantry or cavalry that would deploy in line during battle. They marched forward as one entity.
The term itself, as used today, does not refer to a distinctive military unit or division (e.g., the Roman legion or the contemporary Western-type battalion), but to the type of formation of an army's troops. Therefore, this term does not indicate a standard combat strength or composition but includes the total number of infantry, which is deployed in a single formation known as a "phalanx".
Many spear-armed troops historically fought in what might be termed phalanx-like formations. This article focuses on the use of the military phalanx formation in Ancient Greece, the Hellenistic world, and other ancient states heavily influenced by Greek civilization.
The earliest known depiction of a phalanx-like formation occurs in the Sumerian Stele of the Vultures from the 25th century BC. Here the troops seem to have been equipped with spears, helmets, and large shields covering the whole body. Ancient Egyptian infantry were known to have employed similar formations. The first usage of the term phalanx comes from Homer's "φαλαγξ", used to describe hoplites fighting in an organized battle line. Homer used the term to differentiate the formation-based combat from the individual duels so often found in his poems.
Historians have not arrived at a consensus about the relationship between the Greek formation and these predecessors of the hoplites.