CalcStudioPro
🗺️
Surveying & Geospatial

Distance Between Coordinates

Calculate great-circle distance between two geographic coordinates instantly

DJ
Dr. James Mitchell, PLS, PE
Professional Land Surveyor and Geodetic Engineer
7 min read
Updated

Inputs

Latitude of first point in decimal degrees (-90 to 90)

Longitude of first point in decimal degrees (-180 to 180)

Latitude of second point in decimal degrees (-90 to 90)

Longitude of second point in decimal degrees (-180 to 180)

Preferred unit for distance output

Results

Distance
Great-circle distance between the two coordinates
Distance (Kilometers)
Distance (Miles)
Distance (Meters)
Initial Bearing
Formula
d = 2R * arcsin(sqrt(sin²((lat2-lat1)/2) + cos(lat1) * cos(lat2) * sin²((lon2-lon1)/2)))
Request plugin

The Distance Between Coordinates Calculator computes the shortest distance between two points on Earth's surface using their latitude and longitude values. This calculator employs the haversine formula, a fundamental geodetic calculation used in surveying, navigation, logistics, and geographic information systems. Whether you're planning surveying operations, calculating route distances, or analyzing geographic data, this tool provides accurate great-circle distances in multiple units. The great-circle distance represents the shortest path between two points on a sphere, making it essential for real-world applications where Earth's curvature matters. Input decimal degree coordinates for your two locations and instantly receive precise distance measurements.

How it works

The calculator uses the haversine formula, which accounts for Earth's spherical shape and provides accurate distances between any two geographic points. The formula calculates the angular distance between coordinates, then converts it to linear distance using Earth's mean radius of 6371 kilometers. The process begins by converting latitude and longitude values from decimal degrees to radians. The formula then computes differences in latitude and longitude, applies trigonometric functions, and derives the angular separation. This angular distance is multiplied by Earth's radius to obtain the great-circle distance. The calculator also determines the initial bearing (compass direction) from the first point toward the second, useful for navigation planning. All results are provided in multiple distance units: kilometers, miles, meters, feet, and nautical miles, allowing professionals to work in their preferred measurement system without additional conversions.

Formula
d = 2R * arcsin(sqrt(sin²((lat2-lat1)/2) + cos(lat1) * cos(lat2) * sin²((lon2-lon1)/2)))
Where R is Earth's mean radius (6371 km), lat and lon are in radians, and d is the great-circle distance along Earth's surface.
💡

Worked example

Consider calculating the distance from New York City (40.7128°N, 74.006°W) to London (51.5074°N, 0.1278°W). Enter these coordinates into the calculator: starting latitude 40.7128, starting longitude -74.006, ending latitude 51.5074, ending longitude -0.1278. Selecting kilometers as your unit, the calculator applies the haversine formula to determine the great-circle distance across the Atlantic Ocean. The result shows approximately 5570 kilometers or 3460 miles. The initial bearing of roughly 51 degrees indicates you'd travel northeast from New York to reach London. This calculation proves invaluable for flight planning, shipping route optimization, and geographic analysis.

Understanding Latitude and Longitude

Latitude measures how far north or south a point lies from the equator, ranging from -90 degrees at the South Pole to +90 degrees at the North Pole. Longitude measures east-west position, ranging from -180 degrees to +180 degrees, with zero degrees at the Prime Meridian. Decimal degrees format represents these measurements as single numbers with decimal places, offering precision suitable for surveying and navigation. For example, New York City is at approximately 40.7128 degrees north latitude and 74.006 degrees west longitude. Understanding this coordinate system is fundamental for surveyors, GIS professionals, and anyone working with geographic data. Modern GPS devices and mapping applications consistently use decimal degrees format, making this the standard for distance calculations. Always verify whether your coordinates use positive numbers for north/east (common in many systems) or signed values, as incorrect coordinate entry produces meaningless results.

The Haversine Formula Explained

The haversine formula calculates great-circle distance on a sphere given two points' latitude and longitude coordinates. Unlike flat-Earth distance formulas like the Pythagorean theorem, haversine accounts for Earth's spherical geometry, making it accurate for real-world surveying and navigation. The formula works by computing the angular distance between two points, then converting this angle to linear distance. Historically, navigators used haversine tables before electronic calculators; today, GPS and mapping systems rely on variants of this formula. The haversine approach avoids numerical instability that can occur with other spherical distance formulas when points are very close together or on opposite sides of the planet. Earth's radius varies slightly at different latitudes due to its oblate spheroid shape, but using the mean radius of 6371 kilometers provides accuracy within 0.5% for most surveying applications. For extremely high-precision geodetic work, ellipsoidal models like WGS84 provide greater accuracy.

Practical Applications in Surveying

Professional surveyors use coordinate distance calculations for site planning, boundary determination, and project management. In land surveying, accurate distance calculations between control points ensure proper layout of property boundaries, roads, and infrastructure. Mining and quarrying operations rely on coordinate distance measurements to track equipment movement and resource extraction boundaries. Environmental surveys use these calculations to monitor habitat changes across geographic regions. Utility companies employ distance calculations for pipeline routing, power line planning, and service territory analysis. Disaster response teams use coordinate distances to estimate coverage areas and plan resource deployment. In real estate development, distance calculations between proposed sites and existing infrastructure inform feasibility studies. Transportation planners use great-circle distances to optimize route efficiency for delivery services, public transit, and logistics networks. Accurate distance data directly impacts project budgets and operational efficiency across industries.

Coordinate Systems and Datums

Different geographic regions and applications use various coordinate systems and geodetic datums. The WGS84 datum, established by the U.S. Department of Defense, serves as the global standard for most GPS devices and online mapping services. Other datums like NAD83, used extensively in North America, or regional systems in specific countries, may differ slightly from WGS84. These differences can create discrepancies of up to several hundred meters in coordinate positions. When performing surveying work, always verify which datum your coordinates reference and ensure consistency across all data sources. Converting between datums requires specific transformation parameters and specialized software. For most distance calculations, using WGS84 decimal degrees provides adequate accuracy unless you're performing high-precision geodetic surveys. Professional surveyors maintain detailed documentation of coordinate systems, datums, and transformation methods used in each project.

Distance Units and Conversions

This calculator provides distance results in five common units: kilometers, miles, meters, feet, and nautical miles. Kilometers serve as the standard international scientific unit, widely used in surveying, mapping, and scientific research. Miles remain common in the United States and some Commonwealth nations for road distances and navigation. Meters offer precision for short-distance measurements, particularly useful in detailed site surveys and construction projects. Feet find application in construction, real estate, and land surveying in countries using imperial measurements. Nautical miles specifically apply to maritime and aviation navigation, where one nautical mile equals one minute of latitude. Understanding when to apply each unit prevents costly errors in project planning and communication. International projects often require presenting distances in multiple units to accommodate team members from different regions. The calculator automatically converts between units, ensuring consistency regardless of your chosen measurement system.

Accuracy Considerations and Limitations

The haversine formula assumes Earth is a perfect sphere, while it actually approximates an oblate spheroid, slightly flattened at the poles. This assumption introduces maximum errors around 0.5% for typical surveying applications but varies depending on latitude and distance. For distances under 1000 kilometers, haversine typically achieves accuracy within 0.05%. Coordinate accuracy itself significantly affects distance calculations—GPS receiver accuracy typically ranges from 5 to 15 meters depending on conditions, introducing uncertainty into distance results. Dense urban environments, tunnels, and heavily forested areas reduce GPS accuracy substantially. For extremely high-precision surveying requiring sub-centimeter accuracy, professional surveyors employ differential GPS, total stations, and laser theodolites rather than standard coordinate distance calculations. Always document the accuracy specifications of your source coordinates and propagate this uncertainty through your calculations. When distances near your calculation's precision limits matter operationally, perform field verification to confirm theoretical results.

Frequently asked questions

What is great-circle distance?
Great-circle distance represents the shortest path between two points on a sphere's surface. Unlike straight-line distance through Earth (which would pass underground), great-circle distance follows the curve of Earth's surface, making it essential for navigation, surveying, and geographic analysis. This distance is also called orthodromic distance.
How do I convert my coordinates to decimal degrees?
If coordinates are in degrees, minutes, and seconds format (e.g., 40°42'46.08N), convert using: decimal degrees = degrees + (minutes/60) + (seconds/3600). For the example: 40 + (42/60) + (46.08/3600) = 40.7128 degrees. North and east are positive; south and west are negative.
Why might my calculated distance differ from map measurements?
Maps project Earth's three-dimensional surface onto two dimensions, distorting distances. Road distances also differ from great-circle distances because they follow terrain and infrastructure rather than straight paths. Additionally, coordinate accuracy variations and different datums can cause discrepancies. Great-circle distance represents the absolute shortest path across Earth's surface.
What does bearing indicate?
Bearing represents the compass direction from your first coordinate toward the second, measured clockwise from north. A bearing of 0 degrees points north, 90 degrees points east, 180 degrees points south, and 270 degrees points west. Bearing helps navigation and understanding relative geographic positions.
Can this calculator handle coordinates across the international date line?
Yes, the calculator correctly handles coordinates on both sides of the international date line (180/-180 degrees longitude). You can enter coordinates with longitudes like -179 degrees and 179 degrees; the formula automatically calculates the shorter path across the date line if appropriate.
What accuracy should I expect from this calculator?
The haversine formula provides accuracy within 0.05% for most distances and latitudes. However, accuracy depends on your coordinate precision and Earth's actual shape variations. For surveying requiring sub-meter accuracy, consult professional surveyors using ellipsoidal models and field verification methods.
How does Earth's radius affect the calculation?
The formula multiplies angular distance by Earth's mean radius (6371 km) to convert angles to linear distance. Earth's actual radius varies from 6357 km at poles to 6378 km at equator. Using mean radius introduces approximately 0.3% maximum error, acceptable for most surveying work but negligible compared to coordinate measurement uncertainty.