Distance Between Two Points Calculator

This distance between two points calculator works in the plane and in space: enter the coordinates and the length of the segment appears at once. For A(1 | 2) and B(4 | 6) the distance is 5 – shown with the midpoint, the slope and the working using the Pythagorean theorem.

Example: Dimension: Plane (x, y) · Point A: x₁ 1 · Point A: y₁ 2 · Point B: x₂ 4 · Point B: y₂ 6 → Distance: Distance d = 5. Source: Wikipedia – Euklidischer Abstand. Updated: .

My ToolboxYour inputs are saved in this browser only.

Result

Distance
Distance d = 5
Midpoint of the segment
Midpoint M = (2.5 | 4)
Coordinate differences
  • Δx = x₂ − x₁ = 3
  • Δy = y₂ − y₁ = 4
Working
  • Formula: d = √((x₂ − x₁)² + (y₂ − y₁)²)
  • Substituting: d = √((3)² + (4)²) = √25 = 5
  • The line through both points has slope m = Δy ÷ Δx = 1.3333333 (angle of inclination 53.130102°).

How it is calculated

The distance between two points is the length of the straight segment joining them. In the plane d = √((x₂ − x₁)² + (y₂ − y₁)²); in space (z₂ − z₁)² goes under the root as well. The formula is the Pythagorean theorem: the coordinate differences Δx and Δy are the legs and the distance is the hypotenuse.

How the tool works

Example and uses

Between A(1 | 2) and B(4 | 6), Δx = 3 and Δy = 4, so d = √(9 + 16) = 5. In space between (1 | 2 | 0) and (4 | 6 | 12) you get √(9 + 16 + 144) = 13. The formula is used in geometry and surveying, with vectors and in computer graphics. For the equation of the line through two points there is the line equation calculator, and for right triangles the Pythagorean theorem calculator. The distance between two places on the globe is a different problem, because it depends on the curvature of the Earth.

Frequently asked questions

How do you calculate the distance between two points?

Use d = √((x₂ − x₁)² + (y₂ − y₁)²): square the coordinate differences, add them and take the square root. For (1 | 2) and (4 | 6) that gives 5.

What is the formula for distance in 3D?

d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²). The third coordinate difference is simply added under the root.

How do I find the distance using vectors?

Form the vector AB = B − A and take its magnitude. The result is the same as with the distance formula.

How do I find the midpoint of a segment?

Average the coordinates: M = ((x₁ + x₂) ÷ 2 | (y₁ + y₂) ÷ 2). The tool shows it next to the distance.

Can a distance be negative?

No. A distance is a length, so it is 0 or more; it is 0 only when both points coincide.

Sources and legal basis

As of: · Editorial policy

Related tools