Find the distance between two points in 2D or 3D space, or the great-circle distance and bearing between two latitude/longitude coordinates.

Point 1
Point 2
Point 1
Point 2

Use decimal degrees (e.g. 40.7128, −74.0060). The result is the straight-line great-circle distance.

Distance
Δx
Δy
Δz
Midpoint
Slope
Kilometers
Miles
Nautical miles
Initial bearing
Formula used
Straight-line (Euclidean) distance between the two points, in your chosen units.

About Distance Calculator

The distance calculator measures the gap between two points in three settings: 2D coordinates, 3D coordinates or geographic latitude/longitude pairs. In 2D and 3D it returns the straight-line Euclidean distance along with the midpoint and, in 2D, the slope of the connecting line.

Geographic mode computes the great-circle distance — the shortest path over the Earth’s surface — using the haversine formula on a sphere of radius 6,371 km, with an orthodromy variant available. Results come in kilometers, miles and nautical miles, together with the initial bearing in degrees and its compass direction.

Coordinates go in as decimal degrees (for example 40.7128, −74.0060 for New York), and angles can be entered in degrees or radians. It is a free tool for geometry homework, mapping projects, flight-planning curiosity and any “how far is it between these coordinates” question.

How to use Distance Calculator

  1. Choose the mode: 2D points, 3D points or geographic.
  2. Enter the coordinates of point 1 and point 2 — decimal degrees for latitude/longitude.
  3. For geographic mode, pick the formula and the result unit: kilometers, miles or nautical miles.
  4. Read the distance, plus the midpoint and slope (2D) or the initial bearing and compass direction (geographic).

Frequently asked questions

In 2D and 3D the calculator uses the Euclidean formula — the square root of the summed squared coordinate differences. For latitude/longitude pairs it uses the haversine great-circle formula on a spherical Earth instead.

It computes the shortest distance between two points over a sphere’s surface from their latitudes and longitudes, assuming an Earth radius of 6,371 km. Accuracy is within about 0.5% of the true ellipsoidal distance.

It is the compass direction, in degrees clockwise from north, that you would set out on at the starting point to follow the great circle. The bearing changes along the route, which is why it is “initial”.

A vertical line has no defined slope, since the run between the x-coordinates is zero. The calculator flags this case instead of dividing by zero.

One nautical mile is 1,852 metres — historically one minute of latitude — and remains the standard distance unit in aviation and shipping. The calculator reports it alongside kilometers and statute miles.

Need help?
Found an issue with this tool? Let our team know.
Report an issue

Add this free tool to your own website — copy and paste the code below.