A distance calculator finds the straight-line distance between two points on a coordinate plane using the distance formula. The distance from (0, 0) to (3, 4) is 5.
On this page

How to use the distance calculator
- Enter x₁ and y₁ for the first point.
- Enter x₂ and y₂ for the second point.
- Read the distance in the same units as the coordinates.
What is the distance formula?
The distance between two points (x₁, y₁) and (x₂, y₂) on a flat coordinate plane comes from the Pythagorean theorem. The horizontal and vertical differences form the two legs of a right triangle, and the straight-line distance is the hypotenuse:
- d = √[(x₂ − x₁)² + (y₂ − y₁)²]
- Δx = x₂ − x₁ and Δy = y₂ − y₁
- The order of the points does not matter, because the differences are squared
Distance calculator worked example
Find the distance from (0, 0) to (3, 4). Δx = 3 and Δy = 4, so d = √(9 + 16) = √25 = 5. This is the classic 3-4-5 right triangle. For (−2, 1) to (4, −7), Δx = 6 and Δy = −8, so d = √(36 + 64) = 10. Negative coordinates work the same way.
| Point 1 | Point 2 | Δx, Δy | Distance |
|---|---|---|---|
| (0, 0) | (3, 4) | 3, 4 | 5 |
| (1, 2) | (4, 6) | 3, 4 | 5 |
| (-2, 1) | (4, -7) | 6, -8 | 10 |
| (0, 0) | (1, 1) | 1, 1 | 1.414 |
| (2, 3) | (10, 9) | 8, 6 | 10 |
| (-5, -5) | (7, 0) | 12, 5 | 13 |
Distance in three dimensions
The distance calculator works with two-dimensional points, plus a latitude/longitude mode for places on Earth. For points in space, add the third difference under the square root: d = √(Δx² + Δy² + Δz²). The distance from (0, 0, 0) to (2, 3, 6) is √(4 + 9 + 36) = 7.
Other kinds of distance
- Manhattan (taxicab) distance: |Δx| + |Δy|, the distance along a grid of streets. From (0, 0) to (3, 4) it is 7.
- Distance on a map: for places on Earth, a flat-plane formula is only approximate. Choose the latitude/longitude mode and the distance calculator uses the haversine great-circle formula with a mean Earth radius of 6,371 km. New York (40.7128, −74.0060) to London (51.5074, −0.1278) is about 5,570 km, or 3,461 miles. Road distance is longer still.
- Distance traveled: speed × time, a different idea from the distance between two points.
Midpoint and slope
Two other common results use the same differences. The midpoint is ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2), and the slope is Δy ÷ Δx. For (1, 2) and (4, 6), the distance is 5, the midpoint is (2.5, 4) and the slope is 4 ÷ 3. Together they describe the segment completely.
Where the distance calculator helps
- Geometry homework: lengths of sides, checking whether a triangle is isosceles or right-angled, finding a circle’s radius from its center and a point.
- Graphics and games: how far apart two objects are on screen.
- Drafting and layout: straight-line distances on a plan drawn to scale; multiply by the scale factor afterward.
- Data analysis: Euclidean distance between two data points with two features.
Checking your answer
The distance is never shorter than the larger of |Δx| and |Δy|, and never longer than their sum. If the distance calculator gives 5 for Δx = 3 and Δy = 4, both checks pass: 5 is at least 4 and at most 7. When both differences are equal, the distance is the difference times √2, about 1.414; from (0, 0) to (1, 1) it is 1.414.
Distance, circles and triangles
Every point at the same distance from a center lies on a circle, which is why the equation of a circle, (x − h)² + (y − k)² = r², looks just like the distance formula squared. To find a circle’s radius from its center (2, 3) and a point on it (5, 7), compute the distance: √(9 + 16) = 5. To test whether three points form a right triangle, find the three side lengths and check whether the squares of the two shorter sides add up to the square of the longest.
Keep the units in mind. If the coordinates are in meters, the distance is in meters; if a map grid uses kilometers, so does the answer. The distance calculator returns the length in whatever unit the coordinates use, so convert afterward if needed, for example multiplying feet by 0.3048 to get meters.
Related converters and calculators
Related calculators:
- Pythagorean calculator: right triangles
- Slope calculator: slope
- Speed calculator: speed
- Root calculator: square roots
Sources
NOAA National Geodetic Survey: Inverse and forward geodetic tool; OpenStax Prealgebra 2e, 2.1: Use the language of algebra.
Questions about this calculator
What is the distance formula?
d = √[(x₂ − x₁)² + (y₂ − y₁)²].
What is the distance from (0,0) to (3,4)?
5.
Does point order matter?
No.
How do I find distance in 3D?
Add Δz² under the square root.
Does this give map distance?
No, it is for flat x, y coordinates.
Check the assumptions and units before relying on a result. Financial, tax and health estimates do not replace advice for your individual circumstances.
Report a calculation issue