Square rig is a generic type of sail and rigging arrangement in which the primary driving sails are carried on horizontal spars which are perpendicular, or , to the keel of the vessel and to the masts. These spars are called yards and their tips, beyond the last stay, are called the yardarms. A ship mainly so rigged is called a square-rigger.
The square rig is aerodynamically the most efficient running rig (i.e., sailing downwind), and stayed popular on ocean-going sailing ships until the end of the Age of Sail. The last commercial sailing ships, windjammers, were usually square-rigged four-masted barques.
Square-rigged masts may also have triangular staysails that are deployed fore-and-aft between masts. The term "square-rigged" can also describe individual, four-cornered sails suspended from the horizontal yards, and carried on either a square-rigged or a mainly fore-and-aft rigged vessel, such as one with a bermuda rigged or gaff rigged mainsail.
"Square-rigged" is also used for the uniform of a rating in the Royal Navy since 1857. It is slang and refers to anyone wearing the famous blue square collar on the shoulders and bell-bottomed trousers. The name perhaps reflects the fact that it was these men who managed the square-rigged sails. The peaked cap uniform worn by Senior Ratings (Petty Officers, Chief Petty Officers and Warrant Officers) and Officers is known colloquially as 'fore-and-aft rig'.
A mast is considered square-rigged if its lowest sail or course is square-rigged, but normally if this is the case it will have a complete set of square-rigged sails. If the course is fore-and-aft, square topsails can still be carried in front of the mast.