A point A to point B distance calculator finds the straight-line distance between two locations when you enter their coordinates. Enter latitude and longitude for both points; the calculator returns a great-circle distance, an estimate of the shortest route over Earth’s surface—not the distance along roads.
Formula
The calculator uses the haversine formula, a standard way to estimate the shortest distance between two points on a spherical Earth. It first finds the central angle between the points, then multiplies that angle by an approximate Earth radius:
a = sin²(Δφ / 2) + cos(φ₁) cos(φ₂) sin²(Δλ / 2)
c = 2 atan2(√a, √(1 − a))
Distance = R × c
- φ₁ and φ₂: latitudes of points A and B, converted from degrees to radians.
- λ₁ and λ₂: longitudes of points A and B, converted from degrees to radians.
- Δφ and Δλ: the differences between the two latitudes and longitudes, in radians.
- a: an intermediate value that represents part of the spherical-triangle calculation.
- c: the central angle between the points, in radians.
- R: the assumed Earth radius, 6,371 km.
The calculator converts the result to miles when that option is selected. The conversion uses 1 mile = 1.609344 kilometers. The formula’s trigonometric functions use radians internally, which is why the entered degree values are multiplied by π/180.
Worked Example
Using the default coordinates—A at 40.7128° N, 74.0060° W and B at 34.0522° N, 118.2437° W—and the default kilometer setting:
- Latitude difference: Δφ = (34.0522 − 40.7128)° = −6.6606°.
- Longitude difference: Δλ = (−118.2437 − (−74.0060))° = −44.2377°.
- Convert each difference to radians by multiplying by π/180, then substitute the coordinates into the haversine expression.
- The calculation gives a central angle of approximately 0.6178 radians.
- Distance = 6,371 km × 0.6178 ≈ 3,935.7 km, or about 3,936 km to the nearest kilometer.
This is the approximate straight-line surface distance between the two coordinate points. It is not a road-trip distance or a flight itinerary.
When to Use a Coordinate Distance
A point-to-point coordinate calculator is useful when you need to compare geographic locations without following roads or paths. Common uses include estimating the separation between cities, checking the scale of a map, comparing two GPS readings, or describing how far apart two sites are “as the crow flies.”
Coordinates must refer to the same coordinate system and use the same order. Most everyday latitude-and-longitude values use decimal degrees, with latitude first and longitude second. For example, New York City’s approximate coordinates are 40.7128, −74.0060. A minus sign indicates south for latitude or west for longitude. Do not enter a longitude in the latitude field: the calculator’s valid ranges differ, and swapped values can produce a plausible-looking but incorrect answer.
For locations that are close together, a local map projection or a simple planar distance can sometimes be adequate. For points spread across long distances, use a spherical or ellipsoidal geodesic calculation rather than treating degrees as equal distances. One degree of longitude does not represent a fixed ground distance: it shrinks toward the poles.
How to Read the Result
The output is a distance along an idealized great-circle route: the shortest path between two points on a sphere’s surface. A great circle is the spherical equivalent of a straight line on a flat plane. On a globe, such a route may appear curved on a flat map, especially when it crosses high latitudes.
The calculator uses a mean Earth radius rather than a detailed model of Earth’s slightly flattened shape. The result is therefore an estimate, not a survey measurement. For a broad comparison—such as whether two cities are roughly 500 or 5,000 km apart—it is usually informative. For precise geospatial work, use a geodesic method based on an ellipsoidal Earth model and reliable coordinates.
Distance Versus Travel Distance
A straight-line distance is often shorter than the distance you actually travel. Roads bend around terrain and buildings, routes follow available crossings, and air or sea journeys may use paths shaped by navigation and operating constraints. A route planner calculates a path through a network; this calculator measures only the separation between endpoints.
If the question is “How far apart are these addresses by road?” use a routing service with the exact start and destination, and select the travel mode where available. If the question is “How far apart are these coordinates geographically?” the haversine result is the more relevant measure. Keep the two meanings separate when comparing estimates.
Common Input Problems and Limits
- Wrong coordinate order: Check whether a source lists latitude before longitude. Many formats do, but some mapping and data tools use a different order.
- Missing negative signs: West longitudes and south latitudes are negative in signed decimal-degree notation. Omitting a minus sign can move a point to a different hemisphere.
- Mixed formats: Do not paste degrees-minutes-seconds into a field expecting decimal degrees. Convert the value first, or use a tool that explicitly accepts that format.
- Different datums or poor GPS readings: Coordinate sources may differ slightly. The calculator cannot correct inaccurate or incompatible source data.
- Rounding: The displayed result is rounded to one decimal place. Extra digits in the coordinates do not guarantee that the real-world locations are equally precise.
The calculation also assumes Earth is a sphere of radius 6,371 km. Earth is not a perfect sphere, and elevation is not included; the output measures surface separation, not a three-dimensional distance through the air. These limitations matter more for precision applications than for everyday estimates.
Frequently Asked Questions
How do I calculate the distance between two GPS coordinates?
Enter each point’s latitude and longitude in decimal degrees, keeping the coordinate order and signs correct. The haversine formula then estimates the great-circle distance on Earth’s surface.
Is point A to point B distance the same as driving distance?
No. Point-to-point coordinate distance is a straight-line surface estimate. Driving distance follows roads and depends on the route network, so it is usually longer and requires a directions or routing tool.
What units can I use for the result?
This calculator returns kilometers or miles. One mile is exactly 1.609344 kilometers, so the selected unit changes the displayed measurement, not the underlying locations.
Can I use city names instead of coordinates?
Not in this coordinate calculator. Find the latitude and longitude for each location first. City-name tools typically geocode a name to a point before calculating its distance, and results depend on which point within the city is chosen.
Why does a route look curved on a flat map?
The shortest path on a sphere follows a great circle. When projected onto many flat maps, a great-circle route appears curved because flattening Earth distorts distances and shapes.
Related
Formula used
in lat1 | Point A latitude | degrees | 40.7128 | -90 | 90 in lon1 | Point A longitude | degrees | -74.0060 | -180 | 180 in lat2 | Point B latitude | degrees | 34.0522 | -90 | 90 in lon2 | Point B longitude | degrees | -118.2437 | -180 | 180 sel unit | Distance unit | Kilometers=1, Miles=1.609344 out distance | Straight-line distance | selected unit | 6371 * 2 * atan2(sqrt((sin((lat2-lat1)*pi/360))^2 + cos(lat1*pi/180)*cos(lat2*pi/180)*(sin((lon2-lon1)*pi/360))^2), sqrt(1-((sin((lat2-lat1)*pi/360))^2 + cos(lat1*pi/180)*cos(lat2*pi/180)*(sin((lon2-lon1)*pi/360))^2))) / unit | 1
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- How to Rebrand a Tech Company Without Confusing Customers
- Starbound Spawn Creature Command Not Working? Fixes
- How to Use AI Coding Tools Without Losing Skills
- Evolve Wraith Guide: How the Stealth Assassin Works
- How Foldable Phone Displays and Hinges Work
- AI Workflow Completion Criteria: How to Check Results