Distance Between Two Places: How It Is Calculated
When you ask a map how far away somewhere is, the answer depends on what kind of distance you mean. The shortest distance between two points on Earth is a straight line through the air, called the great-circle distance. The driving distance follows roads and is always longer. The walking distance follows footpaths and crossings. All three are useful, but they answer different questions, and mixing them up is a common source of confusion.
The great-circle distance is calculated with a formula called the haversine, which treats the Earth as a sphere and works out the shortest path across its curved surface. It needs only the latitude and longitude of the two points. For example, the straight-line distance between Karachi and Lahore is about 1,030 kilometres, even though the road journey is closer to 1,200. Our distance calculator tool uses the haversine formula, so it gives you the as-the-crow-flies figure โ the right number for a flight, a radio link, or a rough sense of how far apart two places are.
Road distance is a different problem entirely. It depends on the road network: motorways, one-way streets, bridges, and traffic. A mapping service calculates it by finding the best route through millions of road segments, which is why the number changes with traffic and with the time of day. Walking and cycling distances add footpaths, crossings, and gradients. None of these can be worked out from coordinates alone โ they need a full map of the roads, which is why they are only available inside a mapping app.
There is also the question of units. Most of the world measures distance in kilometres, but the United States uses miles, and older maps use nautical miles for sea and air. One kilometre is about 0.62 miles, and one nautical mile is 1.852 kilometres. Mixing units up is an easy mistake, especially when comparing distances quoted by different sources. A good calculator shows both, so you can check your numbers against whichever unit the other person is using.
Knowing the straight-line distance has practical uses beyond curiosity. Pilots and drone operators need it for flight planning. Radio amateurs use it to work out whether two stations can reach each other. Hikers use it to estimate how far a peak is, before checking the actual trail length. And anyone buying a plane ticket can use it to sanity-check the flight time: a 1,000-kilometre flight takes about two hours door to door, while a 5,000-kilometre flight takes six or seven.
The next time you wonder how far away something is, start with the straight line. Our distance calculator gives it instantly from two pairs of coordinates, and from there you can open a maps app to see the road or walking route. Understanding the difference between the two numbers โ and why the road is always longer โ turns a simple question into a useful piece of geography you will use again and again.
Frequently Asked Questions
What is the haversine formula?
It calculates the shortest distance between two points on a sphere from their latitudes and longitudes. It is the standard method for as-the-crow-flies distance.
Why is driving distance longer than straight-line distance?
Roads follow terrain, avoid obstacles, and use bridges and junctions. The route is almost always longer than the direct line.
How accurate is a straight-line distance?
Very accurate for most purposes. The Earth is not a perfect sphere, so the error is tiny โ well under one percent for ordinary distances.
More location guides
- How to Find Your Current Location on Any Device
- How to Share Your Live Location Safely with Friends and Family
- Latitude and Longitude Explained in Simple Words
- GPS Accuracy: Why It Goes Wrong and How to Improve It
- What Is a Timezone and How Do You Find Yours?
- Google Maps vs OpenStreetMap: Which Should You Use?
- How GPS Works: Satellites, Signals and Your Phone
- Plus Codes Explained: Addresses for Places Without Street Names
- Location Privacy: How to Protect Where You Go
- Offline Maps: How to Travel Without Internet
- Find My Phone: How Location Helps You Recover a Lost Device
- What Is Geocoding? Turning Addresses into Coordinates
- How to Drop a Pin and Share It with Anyone
- Emergency Location: How to Share Where You Are When It Matters
- IP Address vs GPS Location: What Is the Difference?
- How to Find the Coordinates of Any Place on the Map
- Do Location Services Drain Your Battery? What Really Helps
- Travelling Across Timezones: Beat Jet Lag and Stay on Time
- How Do Maps Know About Traffic? The Data Behind the Colours