"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".
Origins
The expression has disputed origins, though 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.
Armed services
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 1775's 'An Easy Plan of Discipline for a Militia ', 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...