The Marathon course

The name Marathon comes from the legend of Pheidippides, a Greek messenger. The legend states that he was sent from the battlefield of Marathon to Athens to announce that the Persians had been defeated, in August or September 490 BC.
The account of the run from Marathon to Athens first appears in Plutarch's On the Glory of Athens in the 1st century AD which quotes from Heraclides Ponticus's lost work. It also appears in works by Lucian of Samosata (2nd century AD), while according to Herodotus Pheidippides did not run from Marathon to Athens but  from Athens to Sparta asking for military help. If he did indeed run from Marathon to Athens, the most obvious route he could have taken was from Marathon Bay around Mount Penteli from the South, a route which runs to approximately 42 km and set the standard for the modern marathon races.  
The course of the first Olympic marathon races was however variable, and the current distance of 42.195 kilometres (26 miles 385 yards)  did not become a set standard according to IAAF until May 1921. It was the distance previously adopted for the 1908 London Olympic Marathon, dictated by spectator needs (especially those of the royal inhabitants of Windsor Castle, on whose grounds the race started) as much as by historical accuracy.
The dramatic finish of the 1908 Olympic marathon had led to worldwide marathon fever, and it is perhaps not surprising that that particular race was used as the standard measurement for future Olympic and non –Olympic marathons. A huge crowd, including Queen Alexandra, had watched as the little Italian, Dorando Pietri, staggered round the final 385 yards (352 m), falling several times, and eventually being propelled by officials over the line as Irish-American Johnny Hayes got ever closer. Dorando was disqualified and Hayes was awarded the Gold Medal. However, Queen Alexandra was so moved by his plight that the very next day she presented Dorando with a silver-gilt cup.
The 42.195 km and 26 miles 385 yards distances are identical to within half an inch (1.2 cm). The difference between the standard distance and the rounded figure frequently employed (as in the table), 26.22 miles, is slightly over two metres or 6.6 feet. For a marathon course to be certified by the IAAF, the length must not be less than 42.195 km and the uncertainty in the measurement shall not exceed 42 m (i.e., 0.1%).