"Toe the line" is an idiomatic expression meaning either to conform to a rule or standard, or to stand in formation along a line. Other phrases which were once used in the early 1800s and have the same meaning were "toe the mark" and "toe the plank".

The expression has disputed origins, although the two earliest known appearances in print are from the British Army, and the third from the Royal Navy. Those suggested are from public school, the armed services, Bare Knuckle Boxing, or possibly the British House of Commons.[citation needed]
In the earliest known appearance of the phrase in print, The Army Regulator, 1738, an officer forming ranks of soldiers says: "Silence you dogs, toe the line..."
The phrase's next known appearance was in "An Easy Plan of Discipline for a Militia" (1775), in which parading soldiers are instructed to "...bring their toes to the line c g, at the second step they toe the line c h..."
The phrase appeared as a naval term in 1831, describing events of 1803: "..on the quarter deck we were arranged in a line, each with his toes at the edge of a plank..." to be subjected to "...scoldings technically called 'toe-the-line' matches".
The phrase "toeing a line" appeared in Captain Maryatt's story "Poor Jack" (1841), which was published in several American newspapers. It refers to the crew of a ship being marshaled and inspected by a lieutenant.
The most likely origin of the term goes back to the wooden decked ships of the Royal Navy during the late 17th or early 18th century. Barefooted seamen had to stand at attention for inspection and had to line up on deck along the seams of the wooden planks, hence to "toe the line".
The first known mention of seamen toeing the line in literature stems from a story about navy life widely published in 1831 that was written by Captain Basil Hall RN. Hall served in the Royal Navy from 1802.[citation needed]
Some military parade grounds have white lines marked, along which soldiers form up, with their toes just touching the line.[citation needed]
A common practice in many long-established schools is for roll-call to be taken twice a day, when the pupils line up with their toes exactly along a particular line on the floor, while their names are called out for their response, indicating their presence.[citation needed]
Reference to toeing the line in schools appeared in 1845: "...the class formed themselves, 'toed the line'..."
A common but erroneous folk etymology is that the idiom originated in the British House of Commons, where sword-strapped members were supposedly instructed to stand behind lines that were two sword-lengths apart from their political rivals in order to restore decorum. No record exists, however, of a time when Members of Parliament were even allowed to bring swords into the Chamber. Historically, only the Serjeant at Arms carries a sword as a symbol of his role in Parliament. In fact, loops of pink ribbon have been and still are provided in the Members' cloakroom for MPs to hang up their swords before entering the Chamber as a result of this rule. The Chamber itself did not have any lines in the days when gentlemen carried swords.
A slightly different use of the term was found in an 1816 magazine, which stated: "The Thalweg of the Rhine shall toe the line of separation between France and the German States; ..." The meaning in this context was marked the line of separation.[citation needed]
An earlier 1813 publication had used the term toe the mark with the same meaning as the modern usage of toe the line, where the author wrote: "He began to think it was high time to toe the mark."
An 1828 publication also used toe the plank with a similar meaning.
Over the years the term has been attributed to sports, including toeing the starting line in track events and toeing a center line in boxing, where boxers were instructed to line up on either side of to start a match. The earlier boxing term, however, was toeing the scratch, referring to a scratch mark on the floor. One of the earliest references related to an English prize fight in 1840.
The Byam Shaw painting Toeing the Line (c. 1890-1899), depicting a scene at Ascot, implies that it was a term used in horse racing.[citation needed]
"Toe the line" is often misspelled as "tow the line", substituting a familiar verb "tow" for the unfamiliar verbal use of "toe". Inasmuch as "tow" does not accord with any of the known proposed etymologies, "tow the line" is a linguistic eggcorn.
The contemporary usage of "toe the line" include various contexts:[citation needed]
The first published use in a political context was in March 1826, when Willie Mangum of the United States House of Representatives proposed that: "...every member might 'toe the mark'." The behavioral use also stems from around that time.[citation needed]
The term continues to be used in the context of cross-country and track and field running, although sometimes also symbolically in bicycle races to be at one's mark along the starting line before a race.
Besides its literal use in middle and long-distance running, the term is still in literal use in the military, particularly the US Army. Some barracks have two solid lines, each approximately three inches (8 cm) wide and placed five feet (152 cm) apart, either taped or painted, running down the center of the entire length of their floor. The soldiers are ordered to "toe the line". At this command they cease their activities and line up with their toes on the line.
In an odd form of an extension of military discipline, "toe the line" is a phrase used in prison or jail settings when guards expect prisoners to line up for a variety of reasons such as a basic head count, full roll call, prisoner or cell searches, at meal time, or to meet any number of other reasons when it comes to accomplishing a task or goal involving the imprisoned where order is necessary. In the jail or prison scenario, to "toe the line" literally means stepping up to or following the lines which are commonly found as painted on or otherwise applied to the floors of the prisons.[citation needed]
In the game of darts, many places where it is played have a line marked on the floor that shows the closest point that the player may stand when launching darts at the dartboard.[citation needed]
In 1946, the writer George Orwell explicitly disparaged the idiomatic use of the phrase as an example of "worn-out metaphors which have lost all evocative power and are merely used because they save people the trouble of inventing phrases for themselves".
The expression is used in the line "Trying just to make you toe the line" from the Beatles song "Run for Your Life" (1965).[citation needed]
The expression is mentioned in the Lindsey Buckingham song "Walk A Thin Line" on the class Fleetwood Mac album "Tusk" (1979).[citation needed]
The expression is the basis for the hit Rocky Burnette song "Tired of Toein' the Line" (1980).[citation needed]