Distance Between Two Points Calculator
Calculate the straight-line distance between two 2D coordinates.
Calculator Inputs
Your Result
Enter your details and press Calculate to see your result.
Formula
How it works
- Enter the coordinates of the first point (x₁, y₁).
- Enter the coordinates of the second point (x₂, y₂).
- View the straight-line distance between them.
Share on Social Media:
The distance between two points (x₁, y₁) and (x₂, y₂) on a flat coordinate plane is √((x₂ − x₁)² + (y₂ − y₁)²). Enter the coordinates of both points and this calculator gives the straight-line distance to 4 decimal places. Coordinates can be negative or decimal.
The distance formula
d = √((x₂ − x₁)² + (y₂ − y₁)²)
It's Pythagoras' theorem. The horizontal gap (x₂ − x₁) and the vertical gap (y₂ − y₁) are the two short sides of a right-angled triangle, and the distance is the hypotenuse.
Worked examples
- (0, 0) to (3, 4): √(3² + 4²) = √25 = 5.
- (1, 2) to (4, 6): gaps of 3 and 4, so the distance is again 5.
- (−2, 3) to (4, −5): gaps of 6 and −8. √(36 + 64) = √100 = 10.
Squaring makes negative gaps positive, so it doesn't matter which point you call the first.
Related formulas
- Midpoint: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2). The midpoint of (0, 0) and (4, 6) is (2, 3).
- Slope: (y₂ − y₁) ÷ (x₂ − x₁). Use the Slope Calculator.
- 3D distance: add a third term, √(Δx² + Δy² + Δz²).
- Manhattan distance: |Δx| + |Δy|, the distance travelled along a grid of streets, never shorter than the straight line.
Not for map distances
This is the distance on a flat plane, in whatever units your coordinates use. Latitude and longitude are angles on a curved Earth, so they need the haversine formula instead; plugging them in here gives a wrong answer.
Related: Triangle Area Calculator, Root Calculator.