The following link provides a complete list of topics on this forum:
How was the radius of the Earth calculated?
Eratosthenes calculated the circumference of the earth without leaving Egypt.
Eratosthenes knew that on the summer solstice at local noon in the Ancient Egyptian city of Swenet (known in Greek as Syene, and in the modern day as Aswan) on the Tropic of Cancer, the sun would appear at the zenith, directly overhead.
He also knew, from measurement, that in his hometown of Alexandria, the angle of elevation of the sun would be 1/50 of a full circle (7°12') south of the zenith at the same time.
Assuming that Alexandria was due north of Syene he concluded that the distance from Alexandria to Syene must be 1/50 of the total circumference of the earth.
His estimated distance between the cities was 5000 stadia (about 500 geographical miles or 800 km) by estimating the time that he had taken to travel from Syene to Alexandria by camel.
He rounded the result to a final value of 700 stadia per degree, which implies a circumference of 252,000 stadia.
The exact size of the stadion he used is frequently argued. The common Attic stadium was about 185 m, which would imply a circumference of 46,620 km, i.e. 16.3% too large.
However, if we assume that Eratosthenes used the "Egyptian stadium" of about 157.5 m, his measurement turns out to be 39,690 km, an error of less than 1%.