Skip to content
ToolsLeb ToolsLeb

Distance Between Two Points Calculator

Calculate the straight-line distance between two 2D coordinates.

Standard Math

Calculator Inputs

Your Result

Enter your details and press Calculate to see your result.

Formula

Distance Between Two Points = (((x₂ − x₁)^2) + ((y₂ − y₁)^2))^0.5
x₂
x₁
y₂
y₁

How it works

  1. Enter the coordinates of the first point (x₁, y₁).
  2. Enter the coordinates of the second point (x₂, y₂).
  3. 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.

Frequently Asked Questions

The straight-line (Euclidean) distance between two points on a 2D plane, given their x and y coordinates.

The distance formula derived from the Pythagorean theorem: the square root of the sum of the squared differences in x and y coordinates.

Common in geometry problems, computer graphics, game development, and any application working with coordinate-based positions.

This tool calculates 2D (x, y) distance specifically — 3D distance would need a z-coordinate added to the same underlying formula.

Distance = √((x₂ − x₁)² + (y₂ − y₁)²), derived directly from the Pythagorean theorem applied to the horizontal and vertical differences between two points.

Yes — the formula works the same way regardless of whether coordinates are positive or negative, since it uses the squared difference between each pair of x and y values.

This calculates straight-line distance on a flat 2D plane using standard x,y coordinates. Real-world GPS distance between latitude/longitude points requires a different formula (like the Haversine formula) that accounts for the Earth's curvature.