Distance Calculator: Calculate Distance Between Two Cities Using Latitude Longitude


Geographic Distance Calculator

Calculate the distance between two cities using latitude and longitude coordinates.

Calculator

City 1 Coordinates


Enter the latitude of the first city in decimal degrees.


Enter the longitude of the first city in decimal degrees.

City 2 Coordinates


Enter the latitude of the second city.


Enter the longitude of the second city.


Great-Circle Distance

Awaiting valid inputs…


What is Geographic Distance Calculation?

When you need to calculate the distance between two cities using latitude longitude, you’re looking for the shortest path between them on the Earth’s surface. This isn’t a straight line in the way we’d draw one on a flat map, but rather a curved arc known as the “great-circle distance.” This method accounts for the planet’s spherical shape, providing a far more accurate measure for long distances than simple geometry. This calculator is essential for logisticians, travelers, geographers, and anyone needing to estimate travel distance or spatial relationships between points on the globe.

The Haversine Formula: How to Calculate Distance

The core of this calculator is the Haversine formula. It’s a specific equation used in navigation to calculate the great-circle distance between two points on a sphere from their latitudes and longitudes. While the Earth is technically an oblate spheroid (slightly flattened at the poles), using a spherical model is sufficient for most applications and provides a very close approximation. For a deeper dive into the math, see our guide on the Haversine formula.

The formula is:

a = sin²(Δφ/2) + cos(φ1) * cos(φ2) * sin²(Δλ/2)

c = 2 * atan2(√a, √(1−a))

d = R * c

Haversine Formula Variables
Variable Meaning Unit Typical Range
φ1, φ2 Latitude of point 1 and point 2 Radians -π/2 to +π/2
λ1, λ2 Longitude of point 1 and point 2 Radians -π to +π
Δφ, Δλ Difference in latitude and longitude Radians Varies
R Radius of Earth Kilometers or Miles ~6,371 km or ~3,959 mi
d The final distance Kilometers or Miles 0 to ~20,000 km
Comparison of Calculated Distance to Earth’s Radius Distance: 0 km

Radius: 6,371 km

Chart comparing the calculated distance to the Earth’s radius.

Practical Examples

Let’s see how to calculate the distance between two cities using latitude longitude with real-world examples.

Example 1: New York City to London

  • Inputs:
    • NYC (Lat 1): 40.7128° N
    • NYC (Lon 1): 74.0060° W
    • London (Lat 2): 51.5074° N
    • London (Lon 2): 0.1278° W
  • Results:
    • Distance: ~5,585 Kilometers
    • Distance: ~3,470 Miles

Example 2: Sydney to Tokyo

  • Inputs:
    • Sydney (Lat 1): 33.8688° S
    • Sydney (Lon 1): 151.2093° E
    • Tokyo (Lat 2): 35.6895° N
    • Tokyo (Lon 2): 139.6917° E
  • Results:
    • Distance: ~7,825 Kilometers
    • Distance: ~4,862 Miles

If you need to convert coordinates, our coordinate conversion tool can help.

How to Use This Geographic Distance Calculator

Using our tool to calculate the distance between two cities using latitude longitude is straightforward:

  1. Enter City 1 Coordinates: Input the latitude and longitude for your starting point in the first two fields. Use negative values for South latitude and West longitude.
  2. Enter City 2 Coordinates: Do the same for your destination point in the next two fields.
  3. Select Your Unit: Choose whether you want the result displayed in kilometers or miles from the dropdown menu.
  4. Read the Result: The great-circle distance is automatically calculated and displayed in the results box. The intermediate values from the Haversine formula are also shown for transparency.

Key Factors That Affect Distance Calculation

  • Earth’s Shape: The Haversine formula assumes a perfect sphere. For most purposes, this is highly accurate. However, since Earth is an oblate spheroid, for extremely high-precision tasks like aviation or surveying, more complex formulas like Vincenty’s might be used.
  • Coordinate Accuracy: The precision of your result is directly tied to the precision of your input coordinates. A small error in latitude or longitude can lead to significant differences over long distances.
  • Elevation: This calculator measures distance along the surface of the sphere. It does not account for changes in altitude or elevation between the two points.
  • Calculation Method: While Haversine is standard, other methods exist. The equirectangular approximation is faster but less accurate, especially near the poles. You can compare methods using a distance formula comparison tool.
  • Data Source: Where you get your lat/lon data matters. GPS coordinates are generally more accurate than those estimated from a map or address.
  • Path vs. Distance: This tool calculates the shortest mathematical distance, not the actual travel route. Roads, flight paths, and natural obstacles will make the travel distance longer.

Frequently Asked Questions (FAQ)

Why is this distance different from Google Maps?

Google Maps calculates routing distance, considering roads, traffic, and one-way streets. Our calculator provides the direct “as the crow flies” great-circle distance, which is the shortest geographical path.

What is the most accurate formula to calculate distance?

For most applications, the Haversine formula is the best balance of accuracy and computational efficiency. For precision down to the millimeter, Vincenty’s formulae are more accurate as they model the Earth as an ellipsoid, but they are much more complex to compute. A GIS data tool might be required for that level of precision.

Can I use decimal or degrees/minutes/seconds (DMS) format?

This calculator requires decimal degrees. If you have coordinates in DMS, you must convert them first. We have a DMS to Decimal converter for this purpose.

What do the intermediate values mean?

The intermediate values (‘a’ and ‘c’) are parts of the Haversine formula. ‘a’ is the square of half the chord length between the points, and ‘c’ is the angular distance in radians. They show the mathematical steps to the final answer.

Does this calculator work for short distances?

Yes, but for very short distances (e.g., across a city), the curvature of the Earth is less significant, and a simpler Pythagorean calculation might be sufficient. However, the Haversine formula remains accurate even at small scales.

What is a ‘great-circle’?

A great circle is the largest possible circle that can be drawn on a sphere. The shortest distance between any two points on a sphere lies along the arc of a great circle connecting them.

How are negative latitudes and longitudes handled?

The standard convention is followed: positive latitude is North, negative is South. Positive longitude is East, negative is West. This calculator correctly processes these signs.

What is the maximum possible distance this calculator can show?

The maximum great-circle distance is approximately half the Earth’s circumference, about 20,000 kilometers or 12,450 miles, which is the distance to the point directly opposite on the globe (the antipode).

Related Tools and Internal Resources

Explore other tools and resources to help with your geographic calculations:

© 2026 GeoCalculators. All rights reserved.



Leave a Reply

Your email address will not be published. Required fields are marked *