Measure the straight-line distance between two points on a plane, in 3D space, or between two latitude and longitude positions on the Earth.
Enter the x and y coordinates of both points.
Enter latitude and longitude as decimal degrees or as degrees, minutes and seconds. South and west are negative in decimal form.
To measure the straight line between two points on a flat grid, treat the horizontal and vertical gaps as the two shorter sides of a right triangle. The distance is the long side: d = √((x₂ − x₁)² + (y₂ − y₁)²). For (1, 1) and (4, 5) the gaps are 3 and 4, so d = √(9 + 16) = √25 = 5, the classic 3-4-5 triangle. The order of the points does not matter, and the result is never negative. The 2D result also gives you the slope, angle and equation of the line joining the two points.
In 3D you add one more squared gap: d = √(Δx² + Δy² + Δz²). That is useful for more than computer graphics. The longest straight object that fits in a room 4 m long, 3 m wide and 2.5 m high is the corner-to-corner diagonal, √(16 + 9 + 6.25) = √31.25, about 5.59 m. If you are working in 2D and want the angle between the points, the Slope Calculator gives it directly.
Latitude and longitude points sit on a curved surface, so the flat formula does not work over any long distance. This calculator finds the shortest path along the Earth’s surface, the so-called great-circle or “as the crow flies” distance, using a model of the Earth as a slightly flattened sphere (an ellipsoid). Washington, D.C. to Philadelphia comes out at about 200 km (124 miles). It is always shorter than a road or flight route, which is why a driving trip between the same two places is longer. For road distances and travel time in the US, use the Mileage Calculator.
In decimal form, north latitudes and east longitudes are positive and south latitudes and west longitudes are negative, so Washington, D.C. is about 38.9, −77.0. If your coordinates are written as degrees, minutes and seconds (38° 53′ 51″ N), switch to the second option and choose N or S and E or W instead of using minus signs. Latitude must be between −90 and 90 and longitude between −180 and 180.
The distance formula gives the straight-line, or Euclidean, distance. In a city laid out as a grid you cannot cut across blocks, so the distance you actually walk is the sum of the horizontal and vertical gaps. For (1, 1) and (4, 5) that is 3 + 4 = 7 blocks, against 5 in a straight line. If you need to turn a distance into a travel time, divide it by your speed, or let the Speed Calculator do it.
If the distance you found is one side of a triangle, the Right Triangle Calculator finds the rest, and the Pythagorean Theorem Calculator handles the same formula when you already know two sides. For a triangle with no right angle, use the Triangle Calculator.
d = √((x₂ − x₁)² + (y₂ − y₁)²). It comes from the Pythagorean theorem, with the horizontal and vertical gaps as the two shorter sides.
Use the latitude and longitude section. Enter each place in decimal degrees (south and west are negative) or in degrees, minutes and seconds, and the calculator gives the great-circle distance in kilometres and miles.
Roads bend around obstacles and follow a network. The straight-line figure is the shortest possible path, so any road or flight route is at least as long.
Add the squared difference of the z-values inside the square root: d = √(Δx² + Δy² + Δz²).
It uses an ellipsoidal model of the Earth and is accurate to well under a percent for most pairs of points, which is far more accurate than simple spherical shortcuts.
Pick another tool to jump straight to it.