Distance calculator – measure distance on a map

Click two or more points on the map, or search for towns, to measure the straight-line distance between them in kilometres, miles, metres, feet or nautical miles. Each leg is a geodesic on the WGS84 ellipsoid, the shortest path over the Earth's surface, accurate to well under a millimetre for the points you choose. It runs in your browser; nothing is uploaded. Share the line with a link or export it as KML, GeoJSON or GPX.

Click on the map to add points. Drag a point to move it.

    Need another format? Convert the KML to a shapefile on FileReshape.

    Map and data: OpenFreeMap, MapLibre GL JS, GeographicLib (geographiclib-geodesic), GeoNames (via all-the-cities) – all data sources.

    The distance calculator measures how far it is from one place to another as the crow flies, and along a route of several stops. Click the map to drop points, drag them to fine-tune, or type a town name to add it. The panel lists every point with the length of the leg leading to it and the running total, and for a single leg it also shows the bearing at the start and at the end, which differ on long legs because the shortest path over a curved Earth is not a straight line on the map. Long legs are drawn as the curve they really follow, which is why a line from New York to Tokyo bends north over Canada and Alaska. Use it to check the length of a hiking route, the reach of a radio link, the flight distance between two airports, or how far apart two properties are.

    How to use it

    1. Click on the map where the line should start, or search for a town and pick it from the list.
    2. Click the next point, and as many more as you need; each click adds a leg to the line.
    3. Drag a numbered point to move it, or remove one with its × button; read the total in the panel.
    4. Change the unit at any time, then copy the share link or download the line as KML, GeoJSON or GPX.

    How accurate is it?

    Geodesic, not a sphere and not a flat map

    Every leg is solved with GeographicLib's inverse geodesic problem on the WGS84 ellipsoid, the model used by GPS, so the computed length between the two points is exact to a few nanometres. Many websites use the haversine formula on a sphere instead. That is quick, but up to about 0.5 % off: from Copenhagen to Aalborg it gives 223.37 km where the ellipsoid gives 223.92 km, and a north–south leg of 10 degrees near the equator is 6 km too long on a sphere.

    Your clicks are the limit

    The measurement is only as good as where you put the points. When the map shows a whole town, one pixel is about 20 m on the ground; zoom in before clicking if you need metre accuracy. A town from the search list is placed at the coordinate GeoNames gives for its centre, so a distance between two towns is a centre-to-centre distance, not the distance between their nearest edges.

    Height is not included

    The distance is measured over the ellipsoid surface at sea level. Going up and down hills adds very little over long distances, but on a steep mountain path the walked distance is longer than the map distance: a slope of 10 % adds half a percent, a slope of 30 % about 4 %.

    Good to know

    Straight line versus the road

    The calculator measures straight-line distance. Roads, paths and rivers wind, so a driving distance is often 20–40 % longer, and much more around fjords, lakes or mountains. For travel times you need a route planner.

    The shortest path looks curved on the map

    Web maps use the Mercator projection, which stretches the far north and south. The shortest path between two distant points therefore appears as an arc bending towards the nearest pole, and a straight ruler line on the map is longer. The bearing you start with is not the bearing you arrive with.

    Nautical miles at sea and in the air

    One nautical mile is exactly 1,852 m, the unit used in aviation and shipping. A statute mile is 1,609.344 m. Switch the unit and every number in the panel is recalculated, without changing the line.

    Frequently asked questions

    How do I measure the distance between two places on a map?

    Click on the first place, then on the second; the distance appears in the panel at once. You can also type two town names into the search box one after the other. Drag either point to adjust it.

    Can I measure a route with several stops?

    Yes. Keep clicking to add points, up to 200. The list shows the length of each leg and the running total, so you can read off the distance to every stop along the way.

    Is this the same as the distance Google Maps shows?

    The "measure distance" tool in Google Maps also measures in a straight line and gives nearly the same result. The directions in Google Maps follow roads and are longer. This calculator adds legs, bearings, several units, a share link and exports.

    What is the bearing?

    For a single leg the panel shows the compass direction at the start and at the end of the line, in degrees from true north. On long legs they differ because the shortest path over the ellipsoid changes direction.

    How do I get the line into Google Earth or a GPS?

    Download it as KML for Google Earth and Google My Maps, as GPX for GPS devices and outdoor apps, or as GeoJSON for GIS software. The KML and GeoJSON contain the curved line plus a point for each stop.

    Something wrong or missing? E-mail [email protected] and it will be fixed.