Latitude Longitude Distance Calculator

 

Calculate the shortest surface distance between two latitude/longitude coordinates on a spherical Earth. Results are great-circle distances, not driving routes, walking directions or surveyed measurements.

Point 1
Point 2

Use decimal degrees: north/east are positive, south/west negative. For example, 40.7128 and -74.0060. Enter latitude first. Degrees-minutes-seconds notation and place names are not accepted.

JavaScript is required for interactive calculations. The method and examples below remain available.

How latitude and longitude distance works

Latitude measures north or south of the equator, from -90 to 90 degrees. Longitude measures east or west of the prime meridian, from -180 to 180 degrees. Two longitude values of -180 and 180 identify the same meridian. At either pole, every longitude identifies the same position.

A great circle is a circle through the center of a sphere. The shorter arc between the two points gives the shortest spherical surface distance. This differs from the straight chord through the Earth and from the route traveled along streets or trails.

Great-circle calculation method

Convert coordinate angles to radians. Let a and b be the two latitudes and d be the wrapped longitude difference. Compute x = cos(b) x sin(d), y = cos(a) x sin(b) - sin(a) x cos(b) x cos(d), and z = sin(a) x sin(b) + cos(a) x cos(b) x cos(d).

The central angle in radians is atan2(sqrt(x squared + y squared), z). Multiply it by Earth radius 6371.0088 km to obtain distance. The vector-based formula remains useful near coincident and opposite points, where a simple inverse-cosine calculation can lose precision.

Worked example: one degree along the equator

Enter Latitude 1 (degrees) 0, Longitude 1 (degrees) 0, Latitude 2 (degrees) 0 and Longitude 2 (degrees) 1. Select Calculate distance. The central angle is 1 degree, giving approximately 111.195080 km, 69.093420 miles or 60.040540 nautical miles on this model.

One degree of longitude does not represent the same distance at every latitude. Longitude lines converge toward the poles. Do not apply an equatorial kilometers-per-degree figure to an arbitrary pair of coordinates.

Crossing the international date line

Coordinates (0, 179) and (0, -179) are separated by a two-degree equatorial arc, not a 358-degree arc. Their distance is approximately 222.390160 km. The calculation wraps the longitude difference to find the shorter arc.

Identical coordinates return zero. Opposite points return half the circumference of the model sphere, approximately 20015.114442 km. Multiple great-circle routes connect exact opposite points; this tool reports distance without choosing a route or bearing.

Spherical distance versus route distance

This model uses a mean Earth radius rather than an ellipsoidal geodesic. Differences from an ellipsoidal calculation depend on the locations and can reach roughly half a percent. Extra displayed decimals do not remove model error or improve the accuracy of your source coordinates.

For driving time or walking distance, use a routing service with road and path data. This tool does not request maps, geocode addresses, access your location or account for terrain. It is not intended for navigation, property boundaries or construction surveying.

If your coordinates are x and y on a flat grid rather than latitude and longitude, use the Distance Between Two Points Calculator.

For a step-by-step walkthrough, read How to Calculate Distance Between Latitude and Longitude Coordinates.

Precision and privacy

Inputs use finite floating-point numbers and results display up to six decimal places, with scientific notation for tiny nonzero distances. Coordinate precision and the Earth model limit practical accuracy. Calculations run locally; the calculator does not save or send your coordinates. The hosting website may use separate analytics or advertising services.

Comments

Popular posts from this blog

How to Calculate Mulch Needed: Cubic Yards and Bags

How to Calculate Billable Hours: Minutes, Rates and Billing Increments

How to Calculate Macros: Calories, Percentages and Grams