calculating distance using lat long


Latitude Longitude Distance Calculator

Calculate the great-circle distance between two points on Earth.


Decimal degrees (-90 to 90)


Decimal degrees (-180 to 180)


Decimal degrees (-90 to 90)


Decimal degrees (-180 to 180)



Enter coordinates to see the distance.

Intermediate Calculation Values

Calculation details will appear here.

Chart comparing calculated distance to a reference.

What is Calculating Distance Using Lat Long?

Calculating distance using latitude and longitude coordinates is the process of finding the shortest distance between two points on the surface of the Earth. This isn’t a simple straight line on a flat map; instead, it’s a curve along the planet’s surface, known as the “great-circle distance”. It represents the shortest path an airplane or ship would take, ignoring external factors like wind or currents. This calculation is fundamental in fields like aviation, maritime navigation, logistics, and geographic information systems (GIS). Anyone needing to know the real-world surface distance between two locations relies on this type of calculation, which is far more accurate than measuring on a flat projection. Our Geodistance Calculator uses this principle.

The Haversine Formula and Explanation

The most common method for calculating distance using lat long is the **Haversine formula**. This formula models the Earth as a perfect sphere and is highly accurate for most applications. The formula works by calculating the angular distance between two points and then converting that angle to a surface distance using the Earth’s radius.

The core 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 (auto-inferred) 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 -π to +π
R Earth’s mean radius km, mi, or nmi ~6371 km / 3959 mi
d The final great-circle distance km, mi, or nmi 0 to ~20,000 km

Practical Examples

Example 1: London to New York

Let’s calculate the distance from London, UK (Latitude: 51.5074°, Longitude: -0.1278°) to New York City, USA (Latitude: 40.7128°, Longitude: -74.0060°).

  • Inputs: Lat1=51.5074, Lon1=-0.1278, Lat2=40.7128, Lon2=-74.0060
  • Units: Kilometers
  • Result: Approximately 5,570 km. Changing units to miles would result in about 3,461 miles.

Example 2: Sydney to Los Angeles

Here, we find the distance between Sydney, Australia (Latitude: -33.8688°, Longitude: 151.2093°) and Los Angeles, USA (Latitude: 34.0522°, Longitude: -118.2437°).

  • Inputs: Lat1=-33.8688, Lon1=151.2093, Lat2=34.0522, Lon2=-118.2437
  • Units: Miles
  • Result: Approximately 7,499 miles. Understanding the Haversine Formula is key to this calculation.

How to Use This calculating distance using lat long Calculator

Using this tool is straightforward. Follow these simple steps for an accurate distance calculation.

  1. Enter Point 1 Coordinates: Input the latitude and longitude for your starting point in the “Point 1” fields. Use negative numbers for South latitudes and West longitudes.
  2. Enter Point 2 Coordinates: Do the same for your destination in the “Point 2” fields.
  3. Select Units: Choose your desired unit of measurement (Kilometers, Miles, or Nautical Miles) from the dropdown menu.
  4. Calculate: Click the “Calculate Distance” button.
  5. Interpret Results: The main result shows the final great-circle distance. The intermediate values box displays the underlying numbers used in the Haversine formula, which can be useful for verification. You can also get a Bearing Calculator to find the direction.

Key Factors That Affect calculating distance using lat long

  • Earth’s Shape: The Haversine formula assumes a perfect sphere. For most purposes, this is fine, but the Earth is actually an “oblate spheroid” (slightly flattened at the poles). This can introduce an error of up to 0.5%.
  • Choice of Formula: For extreme precision over long distances, formulas like Vincenty’s are used, which model the Earth as an ellipsoid. However, they are much more complex to compute.
  • Data Precision: The accuracy of your result is directly tied to the precision of your input coordinates. More decimal places in your lat/long values lead to a more accurate distance.
  • Radius of Earth: The value used for Earth’s radius (R) affects the final distance. This calculator uses the mean radius (6371 km), but the radius varies from the equator to the poles.
  • Route vs. Direct Path: This calculator provides the direct “as the crow flies” distance. Actual travel routes (roads, flight paths) will always be longer due to terrain, obstacles, and infrastructure.
  • Altitude: The calculation is performed at sea level. If calculating between two points at high altitudes (e.g., mountains), the actual distance will be slightly greater.

Frequently Asked Questions (FAQ)

1. Why is the calculated distance shorter than driving distance?
This calculator computes the great-circle path, the shortest possible distance on the Earth’s surface. Driving routes must follow roads, go around obstacles, and are therefore almost always longer.
2. What is the most accurate formula for calculating distance using lat long?
For most uses, the Haversine formula is sufficient. For geodesic precision required by surveying or military applications, Vincenty’s formulae are considered more accurate as they account for the Earth’s ellipsoidal shape.
3. Can I enter coordinates in Degrees, Minutes, Seconds (DMS)?
No, this calculator requires decimal degrees format. You must first convert DMS to decimal (e.g., 40° 42′ 46″ N becomes 40.7128).
4. What’s the difference between a mile and a nautical mile?
A statute mile is 5,280 feet. A nautical mile is based on the Earth’s circumference and is equal to one minute of latitude, making it slightly longer (approx. 6,076 feet). It is primarily used in aviation and maritime navigation.
5. How does longitude affect distance?
The distance between degrees of longitude changes as you move from the equator to the poles. They are widest at the equator and converge to zero at the poles. The Haversine formula correctly accounts for this geometric fact.
6. What does “great-circle distance” mean?
It is the shortest path between two points on the surface of a sphere. If you were to slice a sphere with a flat plane that passes through the two points and the center of the sphere, the arc of that slice is the great-circle path.
7. Is the Earth’s radius constant?
No, the Earth’s radius is larger at the equator (approx. 6,378 km) than at the poles (approx. 6,357 km). This calculator uses a mean radius for a reliable average.
8. What is the maximum possible great-circle distance?
The maximum distance between any two points is approximately half the Earth’s circumference, about 20,000 km or 12,450 miles. This would be the distance to the point directly opposite on the globe (the antipode).

Related Tools and Internal Resources

Explore other useful calculators and resources to expand your knowledge of geospatial calculations.

© 2026 GeoCalculators Inc. All rights reserved. For educational and planning purposes only.



Leave a Reply

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