Distance Between Two Points Calculator
Enter the coordinates of two points on the Cartesian plane to find the straight-line distance between them, the midpoint, and the slope of the connecting segment.
Straight-line (Euclidean) distance between the two points
- 1
Horizontal difference Δx = x₂ − x₁
3 − 0 = 3 - 2
Vertical difference Δy = y₂ − y₁
4 − 0 = 4 - 3
Sum of squares Δx² + Δy²
3² + 4² = 25 - 4
Distance = √(Δx² + Δy²)
√(25) = 5
How does this calculator work?
Use the distance formula d = √((x₂−x₁)²+(y₂−y₁)²) — an application of the Pythagorean theorem — to find the straight-line length between (x₁,y₁) and (x₂,y₂). Enter coordinates to instantly get the distance, the midpoint, and the slope of the connecting segment.
Formula
How this is calculated
The distance between two points is derived from the Pythagorean theorem. If you draw a right triangle whose hypotenuse connects the two points, its horizontal leg has length |x₂ − x₁| (Δx) and its vertical leg has length |y₂ − y₁| (Δy). Applying Pythagoras gives d = √(Δx² + Δy²), which is the Euclidean distance formula.
The midpoint of the segment is the arithmetic mean of the coordinates: M = ((x₁ + x₂)/2, (y₁ + y₂)/2). The slope of the line through the two points is Δy / Δx; it is undefined when the two points share the same x-coordinate (a vertical line).
The formula extends straightforwardly to three dimensions as d = √(Δx² + Δy² + Δz²), and to any number of dimensions. This two-dimensional version is exact for any real coordinates — no approximation is involved.
Frequently asked questions
The output unit matches whatever unit your coordinate values represent. If x and y are in metres, the distance is in metres; if they are in pixels, the result is in pixels. The formula is dimensionless — it scales with the input.
The distance is zero: both Δx and Δy are 0, so d = √(0² + 0²) = 0. The midpoint is the point itself, and the slope is defined only if Δx ≠ 0.
Add a third coordinate: d = √( (x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)² ). The principle is the same — apply Pythagoras twice, once in the horizontal plane and once vertically.
Also known as
TG we-Calculate Editorial Team. (2026). Distance Between Two Points Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/distance-between-two-points-calculator
TG we-Calculate Editorial Team. "Distance Between Two Points Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/distance-between-two-points-calculator.
TG we-Calculate Editorial Team, "Distance Between Two Points Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/distance-between-two-points-calculator
@misc{wecalculate_distance_between_two_points_calculator, title = {Distance Between Two Points Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/distance-between-two-points-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
