Distance Between Cities Calculator — Free Online Distance Tool
Calculate the straight-line (great-circle) distance between any two cities worldwide using their latitude and longitude coordinates. Get results in kilometers, miles, and nautical miles along with compass bearing and estimated travel times.
City 1 (Origin)
City 2 (Destination)
Distance Results
Summary: The straight-line (great-circle) distance between (40.7128, -74.006) and (51.5074, -0.1278) is 5,570.2 km (3,461.2 miles) at a bearing of 51.21° NE. Actual travel distances by road or air may differ due to routing and terrain.
How to Use the Distance Between Cities Calculator
- Enter City 1 (Origin) coordinates: Input the latitude and longitude of your starting city in the first pair of fields. The default is set to New York City (40.7128 latitude, -74.0060 longitude). To find your city's coordinates, search for the city name on any mapping service and look for the coordinate values, or search online for the city name followed by "coordinates." Northern latitudes are positive and southern are negative. Eastern longitudes are positive and western are negative.
- Enter City 2 (Destination) coordinates: Input the latitude and longitude of your destination city in the second pair of fields. The default is London, England (51.5074, -0.1278). You can change this to any city in the world by entering its GPS coordinates. The calculator works for any pair of locations, from neighboring towns to cities on opposite sides of the globe.
- Review the distance results: The results panel instantly shows the great-circle distance in three units: kilometers, statute miles, and nautical miles. It also displays the compass bearing from City 1 to City 2, giving you the initial direction of travel. All values update in real time as you change any coordinate.
- Check estimated travel times: The calculator provides rough travel time estimates based on average speeds: flight time at 900 km/h for air travel and driving time at 80 km/h for road travel. These are approximations for planning purposes. Actual travel times vary based on routing, traffic, weather, and transportation mode.
The calculator uses the Haversine formula, which computes the shortest distance along Earth's surface between two geographic coordinates. This "as the crow flies" distance is the theoretical minimum and will always be shorter than actual road, rail, or air routes.
Haversine Distance Formula
a = sin²(Δlat/2) + cos(lat1) · cos(lat2) · sin²(Δlng/2) c = 2 · atan2(√a, √(1-a)) Distance = R · c (where R = 6,371 km) Variables Explained
- lat1, lat2: The latitudes of the two cities in radians. Latitude measures north-south position from -90 degrees (South Pole) to +90 degrees (North Pole). The formula requires conversion from degrees to radians by multiplying by π/180.
- Δlat, Δlng: The differences between the two cities' latitudes and longitudes, respectively, in radians. These differences are the inputs to the Haversine function that computes the angular separation between the two points.
- a: The square of half the chord length between the two points on the unit sphere. This intermediate value ranges from 0 (points are identical) to 1 (points are antipodal, on exact opposite sides of the sphere).
- c: The angular distance in radians between the two points, computed from the intermediate value a. This represents the central angle subtended by the arc connecting the two points.
- R: The mean radius of Earth, 6,371 kilometers (3,959 miles). This is the average of the equatorial radius (6,378 km) and the polar radius (6,357 km). Using this value introduces a maximum error of about 0.3%.
- Distance: The great-circle distance in kilometers, obtained by multiplying the angular distance c by Earth's radius R. This is the shortest surface distance between the two cities.
Step-by-Step Example
Calculate the distance from New York (40.7128° N, 74.0060° W) to London (51.5074° N, 0.1278° W):
- Convert to radians: lat1 = 0.7106 rad, lat2 = 0.8989 rad, Δlat = 0.1883 rad, Δlng = 1.2880 rad
- Calculate a: sin²(0.0942) + cos(0.7106) · cos(0.8989) · sin²(0.6440) = 0.0089 + 0.764 · 0.627 · 0.361 = 0.182
- Calculate c: 2 · atan2(√0.182, √0.818) = 2 · 0.443 = 0.886 radians
- Calculate distance: 6,371 × 0.886 = 5,570 km (3,461 miles)
The great-circle distance from New York to London is approximately 5,570 kilometers or 3,461 miles. This matches well with published flight distances and confirms the Haversine formula's accuracy for intercontinental calculations.
Practical Examples
Example 1: David Planning a European Vacation
David is planning a multi-city European trip from New York and wants to compare flight distances to decide his route. He enters New York (40.7128, -74.0060) as City 1 and checks distances to London (51.5074, -0.1278), Paris (48.8566, 2.3522), and Rome (41.9028, 12.4964). The calculator shows New York to London at 5,570 km with an estimated flight time of 6 hours 11 minutes, New York to Paris at 5,837 km with 6 hours 29 minutes, and New York to Rome at 6,889 km with 7 hours 39 minutes. David decides to fly to London first since it is the closest, then take short flights or trains to Paris and Rome, optimizing his total travel time and reducing jet lag from a shorter initial transatlantic flight.
Example 2: Maria Comparing Shipping Routes
Maria works in international logistics and needs to compare great-circle distances between Shanghai (31.2304, 121.4737) and three potential destination ports: Los Angeles (33.9425, -118.4081), Rotterdam (51.9244, 4.4777), and Dubai (25.2048, 55.2708). The calculator shows Shanghai to Los Angeles at 10,464 km (5,651 nautical miles), Shanghai to Rotterdam at 9,215 km (4,976 nmi), and Shanghai to Dubai at 6,361 km (3,435 nmi). While Rotterdam appears closer than Los Angeles in great-circle distance, Maria knows that the actual shipping routes differ significantly. The Shanghai-LA route goes directly across the Pacific, while Shanghai-Rotterdam routes through the Suez Canal or around Africa. She uses the great-circle distances as a baseline for fuel cost estimates.
Example 3: James and His Long-Distance Running Goal
James is a marathon runner who tracks his cumulative running distance and has set a goal to run the equivalent of the distance from New York to Los Angeles. He enters New York (40.7128, -74.0060) and Los Angeles (34.0522, -118.2437) into the calculator and finds the distance is 3,940 km (2,449 miles). At his pace of running 40 km per week, James calculates it will take approximately 98.5 weeks (about 1 year and 11 months) to virtually complete this coast-to-coast journey. He creates weekly milestones using the calculator to check which cities along the route he has "reached" based on cumulative distance from New York.
Example 4: Priya Evaluating Study Abroad Options
Priya lives in Mumbai (19.0760, 72.8777) and has been accepted to universities in Toronto (43.6532, -79.3832), Melbourne (-37.8136, 144.9631), and Edinburgh (55.9533, -3.1883). She uses the calculator to compare distances: Mumbai to Toronto is 12,558 km, Mumbai to Melbourne is 10,358 km, and Mumbai to Edinburgh is 7,292 km. The estimated flight times are 13 hours 57 minutes, 11 hours 30 minutes, and 8 hours 6 minutes respectively. Edinburgh is the closest, making it more feasible for semester breaks and family visits. Priya also notes the compass bearings to understand flight routing: northwest to Edinburgh, northeast to Toronto, and southeast to Melbourne, which will help her visualize time zone differences and adjust to the new schedule.
Popular City-to-City Distance Reference Table
| Route | Distance (km) | Distance (mi) | Est. Flight |
|---|---|---|---|
| New York to London | 5,570 | 3,461 | 6h 11m |
| New York to Los Angeles | 3,940 | 2,449 | 4h 23m |
| London to Tokyo | 9,566 | 5,944 | 10h 38m |
| Sydney to Dubai | 12,038 | 7,480 | 13h 23m |
| Chicago to Paris | 6,657 | 4,136 | 7h 24m |
| Toronto to Mumbai | 12,558 | 7,803 | 13h 57m |
Distances are great-circle (straight-line). Flight times assume 900 km/h average cruise speed and do not include takeoff, landing, or taxiing.
Tips and Complete Guide
Understanding Great-Circle vs Road Distance
The distance displayed by this calculator is the great-circle distance, which follows Earth's curvature in a straight line. Actual road distances are always longer because highways, streets, and paths must navigate around terrain features, cross rivers at bridges, and pass through existing infrastructure. As a general rule of thumb, multiply the great-circle distance by 1.2 to 1.4 to estimate road distance in well-developed regions with direct highway connections. In mountainous areas or regions with limited infrastructure, the multiplier can be 1.5 or higher. For island destinations separated by water, road distance is obviously not applicable, and the great-circle distance is the relevant metric for air or sea travel planning.
Coordinate Accuracy and Its Impact
The precision of your input coordinates directly affects the accuracy of the calculated distance. For city-to-city calculations, coordinates rounded to four decimal places (about 11 meters of precision) are more than adequate. Even two decimal places (about 1.1 km precision) produce results accurate enough for comparing intercontinental distances. However, if you are calculating distances between nearby locations (within the same city), higher precision coordinates become important. Use the Coordinates Calculator to convert between different coordinate formats if your source data is in degrees-minutes-seconds rather than decimal degrees.
Using Distance Data for Travel Planning
Beyond simple distance comparison, the calculator's output is useful for several travel planning tasks. Flight fuel consumption estimates use great-circle distance as the primary input. Travel insurance coverage often depends on the distance from home. Time zone differences roughly correlate with east-west distance (each 15 degrees of longitude equals approximately one time zone). The compass bearing shown by the calculator helps you understand the general direction of travel, which is useful for determining whether you will experience jet lag from crossing time zones or just fatigue from a long north-south flight. Use the Directions Calculator for detailed bearing and compass direction analysis.
Common Mistakes to Avoid
- Swapping latitude and longitude: Latitude always comes first (the north-south position, range -90 to +90) and longitude second (the east-west position, range -180 to +180). Swapping these values will give a completely wrong distance. Remember: latitude lines are like rungs of a ladder (horizontal), and longitude lines run vertically.
- Forgetting negative signs for southern and western coordinates: Cities south of the equator have negative latitudes (e.g., Sydney is -33.87). Cities west of the Prime Meridian have negative longitudes (e.g., New York is -74.01). Omitting the negative sign will place the city in the wrong hemisphere and produce an incorrect distance.
- Confusing great-circle distance with travel distance: The calculated distance is the theoretical shortest path on Earth's surface. Actual flight routes may be longer due to airspace restrictions and jet stream routing. Driving distances are significantly longer due to road routing. Use the distance as a baseline, not an exact travel distance.
- Using city center coordinates for airport distance: If you need the distance between airports specifically, use the airport coordinates rather than city center coordinates. Major airports can be 20 to 40 km from the city center, which matters for shorter routes.
- Expecting exact flight time from estimates: The estimated flight times assume constant cruise speed and zero wind. Real flights are affected by jet streams (which can add or subtract over an hour on transatlantic flights), flight routing, airport congestion, and climb and descent phases that occur at lower speeds.
Frequently Asked Questions
The calculator uses the Haversine formula, a mathematical equation that computes the great-circle distance between two points on a sphere given their latitude and longitude coordinates. The great-circle distance is the shortest path between two points on the surface of a sphere, following the curvature of the Earth. The Earth is approximated as a sphere with a radius of 6,371 kilometers (3,959 miles). The formula accounts for the spherical geometry of Earth, which is why it produces accurate results for any distance from a few kilometers to halfway around the globe.
Great-circle distance (also called as-the-crow-flies distance) is the shortest possible distance between two points on Earth's surface, measured along the curvature of the planet. Driving distance is the actual distance traveled by road, which is always longer because roads must follow terrain, go around obstacles, and connect through existing infrastructure. Driving distance is typically 20% to 40% longer than the great-circle distance, depending on the terrain and road network between the two cities. For example, the great-circle distance from New York to Los Angeles is about 3,940 km, while the driving distance is approximately 4,500 km, about 14% longer.
The Haversine formula is accurate to within approximately 0.3% for most distances on Earth. It treats Earth as a perfect sphere with radius 6,371 km, while Earth is actually an oblate spheroid (slightly flattened at the poles and bulging at the equator). For distances under 1,000 km, the error is negligible (less than a few hundred meters). For transcontinental distances, the error may be up to 20 to 30 km compared to the more precise Vincenty formula, which accounts for Earth's ellipsoidal shape. For travel planning purposes, the Haversine formula provides more than sufficient accuracy.
A nautical mile is a unit of distance equal to one minute (1/60 of a degree) of latitude, approximately 1.852 kilometers or 1.151 statute miles. Nautical miles are used in aviation and maritime navigation because they relate directly to the geographic coordinate system. When navigating by latitude and longitude, distances expressed in nautical miles are easier to read from charts and maps. Air and sea speeds are measured in knots, where one knot equals one nautical mile per hour. The calculator displays distances in all three units (kilometers, statute miles, and nautical miles) so the results are useful for any type of travel planning.
The easiest way to find a city's coordinates is to search for the city name followed by the word coordinates in any search engine. You can also use mapping services: open the map, right-click or long-press on the location, and the coordinates will appear in a tooltip or info panel. Most mapping applications display coordinates in decimal degrees format, which is exactly what this calculator accepts. Common reference coordinates include New York (40.7128, -74.0060), London (51.5074, -0.1278), Tokyo (35.6762, 139.6503), Sydney (-33.8688, 151.2093), and Dubai (25.2048, 55.2708). Remember that southern latitudes and western longitudes are negative numbers.
The bearing indicates the compass direction from the first city to the second city, measured in degrees clockwise from true north. This information is useful for understanding the geographic relationship between two locations. A bearing of 0 degrees means due north, 90 degrees means due east, 180 degrees means due south, and 270 degrees means due west. The bearing is the initial direction you would face if you were standing at City 1 and looking toward City 2. For long distances, the actual compass heading changes continuously along the route due to Earth's curvature, which is why the calculator shows the initial bearing at the starting point.
The estimated flight time divides the great-circle distance by an average commercial aircraft cruising speed of 900 km/h (560 mph). This gives a reasonable estimate for the actual in-flight time between two airports. However, real flight times may differ due to headwinds or tailwinds, routing around restricted airspace, departure and arrival procedures, and the fact that flight paths do not always follow the great-circle route. The estimated driving time uses an average speed of 80 km/h (50 mph), which accounts for a mix of highway and city driving, stops, and traffic. Actual driving times depend heavily on road conditions, speed limits, traffic density, and terrain.
The calculator provides the great-circle distance in nautical miles, which is a useful starting point for sea navigation planning. However, actual shipping routes differ significantly from the great-circle path because ships must navigate around landmasses, through canals (like Suez or Panama), and along established shipping lanes for safety and efficiency. For accurate maritime routing, professional navigation software considers ocean currents, weather patterns, port approach procedures, and International Maritime Organization traffic separation schemes. The great-circle distance serves as the theoretical minimum distance and is useful for quick estimates and comparisons between different port pairs.
Related Calculators
Coordinates Calculator
Convert geographic coordinates between DD, DMS, and DMM formats.
Directions Calculator
Calculate compass bearing and direction between two locations.
Unit Converter
Convert between metric and imperial measurement units instantly.
Speed Calculator
Calculate speed, distance, or time given two of the three values.
Fuel Cost Calculator
Estimate fuel costs for any trip based on distance, MPG, and gas price.
Percentage Calculator
Calculate percentages, increases, and differences between values.
Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.
Last updated: February 23, 2026
Sources
- Movable Type Scripts — Haversine Formula and Geodesy: movable-type.co.uk/scripts/latlong.html
- NOAA National Hurricane Center — Latitude/Longitude Distance Calculator: nhc.noaa.gov/gccalc.shtml
- NOAA National Geodetic Survey — Inverse/Forward Geodesic Computations: ngs.noaa.gov/TOOLS/Inv_Fwd