Skip to content
RK Calculator
Menu

Distance Calculator

Find the distance between two points in 2-D or 3-D, or between two places on Earth from their latitude and longitude.

Change the values and press Calculate to work out your own figures.

Two points in a plane

Enter two points.

About x₁First point, x.
About y₁First point, y.
About x₂Second point, x.
About y₂Second point, y.
Result
Distance
3√5
Decimal
6.708203932
Slope
1/2
Angle
26.56505118°

The distance is 3√5 ≈ 6.708203932.

Show the working
  1. d = √((x₂ − x₁)² + (y₂ − y₁)²) = √45

Two points in space

Enter two points.

About x₁First point, x.
About y₁First point, y.
About z₁First point, z.
About x₂Second point, x.
About y₂Second point, y.
About z₂Second point, z.
Result
Distance
√3
Decimal
1.732050808

The distance is √3 ≈ 1.732050808.

Show the working
  1. d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²) = √3

Two places on Earth

Enter both places' latitude and longitude in decimal degrees.

About latitude 1 (°)Decimal degrees, north positive.
About longitude 1 (°)Decimal degrees, east positive.
About latitude 2 (°)Decimal degrees, north positive.
About longitude 2 (°)Decimal degrees, east positive.
Result
Distance (WGS 84 ellipsoid)
200.050 km
In miles
124.3053594 mi
In nautical miles
108.018404 nmi
On a sphere (haversine, R = 6,371 km)
199.8305048 km

The shortest distance over the Earth's surface is 200.050 km (124.3053594 miles).

Show the working
  1. Vincenty's inverse formula on the WGS 84 ellipsoid (a = 6,378,137 m, f = 1/298.257223563)

How to use it

Enter two points. Enter two points. Enter both places' latitude and longitude in decimal degrees.

Enter coordinates as whole numbers, decimals or fractions (3/4). Show the working gives the formula with your numbers.

Key facts

d = √((x₂ − x₁)² + (y₂ − y₁)²)

On the Earth

The shortest route over the surface follows a geodesic; on the WGS 84 ellipsoid it differs from the spherical (haversine) figure by up to about 0.5%.

Questions

What is the distance from (1, 3) to (7, 6)?

3√5 ≈ 6.708203932.

From (0, 0, 0) to (3, 4, 12)?

13.

Formulas

d = √((x₂ − x₁)² + (y₂ − y₁)²)

Sources

Limitations

  • Vectors have two or three components (leave z blank for 2-D).
  • Earth distances assume the WGS 84 ellipsoid (sea level).

Formula version 0.1.0Reviewed