Distance Calculator
Find the straight-line distance between any two points — in 2D or 3D. Enter the coordinates of each point and get the distance instantly, with the full formula working shown, the midpoint, and a plotted graph. Free, no sign-up.
Decimal degrees: New York City is 40.7128, −74.0060. Great-circle distance on a spherical Earth.
Advanced options
The distance formula
It's the Pythagorean theorem in disguise: d = √((x₂−x₁)² + (y₂−y₁)²). The differences in x and y are the legs of a right triangle, and the distance is the hypotenuse. In 3D, add the z-difference squared under the root.
Straight-line vs Manhattan distance
Euclidean distance is the direct "as the crow flies" line. Manhattan distance (|Δx| + |Δy|) is the path along a grid — like city blocks. Manhattan is always ≥ Euclidean; they're equal only when the points share an x or y coordinate.
Frequently Asked Questions
What is the distance formula?
d = √((x₂−x₁)² + (y₂−y₁)²) in 2D; add (z₂−z₁)² inside the root for 3D.
What is the distance between (0, 0) and (3, 4)?
Exactly 5: √((3−0)² + (4−0)²) = √(9+16) = √25 = 5. It's the classic 3-4-5 right triangle.
Does the order of the points matter?
No — the differences are squared, so signs vanish. Distance from A to B equals distance from B to A.
Can I use negative coordinates?
Yes. The formula only cares about the differences between coordinates, so any quadrant works.
What is the midpoint formula?
Average each coordinate: ((x₁+x₂)/2, (y₁+y₂)/2). The calculator shows it under the results.
How is the latitude/longitude distance computed?
With the haversine formula on a spherical Earth (radius 6,371 km / 3,959 mi). It gives the great-circle distance — the shortest path over the surface. Real flight paths are close to this.
NumberTally