Distance Calculator
Distance between two points in a 2D plane, in 3D space, or on Earth's surface — with a click-to-place world map, decimal or degree-minute-second input, and step-by-step working.
What is the distance formula?
The distance formula gives the straight-line (Euclidean) distance between two points. In two dimensions it comes straight from the Pythagorean theorem: the horizontal gap and the vertical gap between the two points form the two legs of a right triangle, and the distance you want is the hypotenuse. The same idea stretches into three dimensions by adding a z-term, and to two places on the Earth's surface — where a curved-space formula (Haversine or Lambert) takes over from flat-space Pythagoras.
Distance is one of the most useful measurements in geometry because so many other questions reduce to it: how long is this segment, how far apart are these two cities, how close is a point to a line, where is the middle of a road, what bearing should a plane fly? Every tab in this calculator is a different flavour of the same question — “how far?” — answered with the right formula for the geometry involved.
Distance formulas explained, method by method
For every method below you'll see a plain-English explanation, the formula (with what each letter means), a diagram, and a worked example — all in one place.
2D distance (Pythagorean)
In a flat plane, subtract the x-coordinates and the y-coordinates. Those two differences are the legs of a right triangle whose hypotenuse is the distance you want. Because each difference is squared, the order of the two points doesn't change the answer.
3D distance
Space adds a third axis, z, so we add a third squared difference. The formula is Pythagoras applied twice — once in the xy-plane, then again with that flat distance and Δz.
Haversine (great-circle on a sphere)
For two points on Earth, the shortest path curves along the surface — a great-circle arc. Haversine assumes a perfect sphere of radius R and gives that arc length directly from the latitudes and longitudes. Convert every angle to radians first.
Lambert's formula (oblate spheroid)
Earth is slightly wider at the equator than pole-to-pole (equatorial 6378 km, polar 6357 km). Haversine can be off by up to about 0.5%. Lambert's formula uses the WGS-84 ellipsoid via reduced latitudes β, then adds a small flattening correction — accurate to about 10 m over thousands of kilometres.
Degrees–Minutes–Seconds to decimal degrees
GPS and old maps often quote latitude/longitude in degrees, minutes and seconds. Convert to decimal degrees before applying any distance formula: divide minutes by 60 and seconds by 3600, then add. South and West become negative.
Features of this calculator
- 2D distance with a live coordinate-plane diagram showing the two points, the right-triangle legs (Δx, Δy) and the connecting distance segment.
- 3D distance with an isometric sketch of the x-, y- and z-axes and both points plotted.
- Latitude/longitude great-circle distance using the Haversine formula, plus Lambert's ellipsoidal formula for higher accuracy — results in both kilometres and miles, along with the initial and final compass bearings.
- Decimal-degrees or degrees-minutes-seconds input, with per-coordinate N/S and E/W selectors.
- Interactive click-to-place world map — set two points, drag either marker, see the great-circle arc and distance update live.
- Show/hide step-by-step working for every calculation, with the formula, substitution, and final value.
- Copy-to-clipboard buttons on every result.
- Manhattan / Chebyshev tab comparing taxicab, chessboard-king and straight-line distance side by side for the same two points.