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: .
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
- Take the differences: Δx, Δy and, in space, Δz. Their signs do not matter because they are squared.
- Add the squares and take the root: The working shows every step with your numbers.
- Midpoint: The mean of the coordinates, M = ((x₁ + x₂) ÷ 2 | (y₁ + y₂) ÷ 2).
- Slope: In the plane m = Δy ÷ Δx and the matching angle of inclination.
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
- Wikipedia – Euklidischer Abstand
- Wikipedia – Euclidean distance
- Wikipedia – Midpoint (midpoint of a line segment)
As of: · Editorial policy
Related tools
- Polar coordinates calculator: convert (x, y) to (r, θ) and backPolar coordinates calculator: converts rectangular coordinates (x, y) to polar (r, θ) and back, in degrees or radians, with the correct quadrant for the angle.
- Pythagorean Theorem CalculatorPythagorean theorem calculator: enter two sides to get the third side, both angles, area and height – with exact square roots, working and a right-angle check.
- Equation of a Line CalculatorEquation of a line from two points or from a point and slope: slope-intercept form, general form, parametric form, x-intercept and working shown at once.
- Vector Calculator with StepsVector calculator for 2D and 3D: sum, dot product, cross product, magnitude, angle and projection of two vectors – instant, with the working shown step by step.
- Triangle CalculatorTriangle calculator from any three values (SSS, SAS, ASA, AAS, SSA): missing sides and angles, area, perimeter, heights, inradius and circumradius.
- Show my GPS coordinatesFind your GPS coordinates: shows your location in decimal degrees, degrees/minutes/seconds, decimal minutes and UTM, ready to copy – or convert coordinates.
- Online CalculatorCalculator online, free and instant: type or tap and see the answer as you go – order of operations, brackets, percent, square root, steps and a history list.
- Power Factor Correction CalculatorPower factor correction calculator: capacitor power and capacitance for single- and three-phase from real power and power factor before and after, with current.
- Point Slope Form CalculatorPoint slope form calculator: get the line equation y − y₁ = m(x − x₁) from two points or from a point and slope, with slope-intercept form and every step.