Free Distance Between Two Points Calculator

Compute the straight-line distance and the midpoint between any two points in the coordinate plane, with the full distance-formula arithmetic shown for each result.

Enter the coordinates of two points to find the distance and midpoint.

Result
Distance d5
Midpoint(1.5, 2)
Δx = x₂ − x₁3
Δy = y₂ − y₁4

d = √((x₂ − x₁)² + (y₂ − y₁)²) = √(3² + 4²)

Quick answer

The distance between two points is d = √((x2−x1)² + (y2−y1)²), the length of the straight line joining them. For the points (0,0) and (3,4): d = √(3² + 4²) = √(9 + 16) = √25 = 5, and the midpoint is ((0+3)/2, (0+4)/2) = (1.5, 2).

Formula & method

Distance (Euclidean)

d = √((x₂ − x₁)² + (y₂ − y₁)²)
  • d straight-line distance between the two points
  • x₁, y₁ coordinates of the first point
  • x₂, y₂ coordinates of the second point

The 2-D Euclidean distance — a direct application of the Pythagorean theorem, where the horizontal gap (x₂−x₁) and vertical gap (y₂−y₁) are the legs of a right triangle and d is the hypotenuse.

Midpoint

M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2)

The midpoint is the point exactly halfway along the segment; each coordinate is the average of the corresponding coordinates of the endpoints.

Examples

Example 1: Classic 3-4-5 right triangle
Input
(x₁,y₁) = (0,0), (x₂,y₂) = (3,4)
Result
d = 5, midpoint = (1.5, 2)
Why
Δx = 3−0 = 3 and Δy = 4−0 = 4, so d = √(3² + 4²) = √(9 + 16) = √25 = 5. Midpoint = ((0+3)/2, (0+4)/2) = (1.5, 2).
Example 2: Two arbitrary points
Input
(x₁,y₁) = (1,2), (x₂,y₂) = (4,6)
Result
d = 5, midpoint = (2.5, 4)
Why
Δx = 4−1 = 3 and Δy = 6−2 = 4, so d = √(3² + 4²) = √(9 + 16) = √25 = 5. Midpoint = ((1+4)/2, (2+6)/2) = (2.5, 4).
Example 3: Points in different quadrants (negatives)
Input
(x₁,y₁) = (−2,−3), (x₂,y₂) = (4,5)
Result
d = 10, midpoint = (1, 1)
Why
Δx = 4−(−2) = 6 and Δy = 5−(−3) = 8, so d = √(6² + 8²) = √(36 + 64) = √100 = 10. Midpoint = ((−2+4)/2, (−3+5)/2) = (1, 1).
Example 4: Vertical segment (same x)
Input
(x₁,y₁) = (2,3), (x₂,y₂) = (2,9)
Result
d = 6, midpoint = (2, 6)
Why
Δx = 2−2 = 0 and Δy = 9−3 = 6, so d = √(0² + 6²) = √36 = 6 — the distance is just the difference in y. Midpoint = ((2+2)/2, (3+9)/2) = (2, 6).

When to use this tool

  • Measuring the straight-line (as-the-crow-flies) distance between two map or screen coordinates.
  • Geometry and algebra homework: verifying segment lengths, midpoints, or whether three points are collinear or form a right triangle.
  • Game development, graphics, and physics, where you need the gap between two (x,y) positions for collision, range, or movement checks.
  • Surveying, CAD, and engineering layout when working from Cartesian coordinates on a single flat plane.

Common mistakes

  • Forgetting to square the differences before adding — you must compute (Δx)² + (Δy)², not (Δx + Δy). For (3,4) that gives √25 = 5, not √7.
  • Mishandling negative coordinates: subtracting a negative is adding. With x₁ = −2 and x₂ = 4, Δx = 4 − (−2) = 6, not 2.
  • Taking the square root of each term separately. √(a² + b²) ≠ a + b; the square root applies to the whole sum, so the radical must come last.
  • Confusing the midpoint formula (average the coordinates) with the distance formula, or dividing the distance by 2 to get the midpoint — the midpoint is a point, not a length.

Frequently asked questions

What is the distance formula?

It is d = √((x₂ − x₁)² + (y₂ − y₁)²). It gives the straight-line distance between two points in the plane and comes directly from the Pythagorean theorem, treating the horizontal and vertical gaps as the two legs of a right triangle.

Does the order of the two points matter?

No. Because the differences are squared, (x₂ − x₁)² equals (x₁ − x₂)², so swapping which point is first gives the same distance. The midpoint is also unaffected, since addition is commutative.

How do I find the midpoint between two points?

Average the x-coordinates and average the y-coordinates: M = ((x₁ + x₂)/2, (y₁ + y₂)/2). For (0,0) and (3,4) the midpoint is (1.5, 2). The midpoint always lies exactly halfway along the segment.

Can I use negative coordinates?

Yes. Just substitute the signed values and be careful with subtraction: 4 − (−2) = 6. The formula works in every quadrant, and the resulting distance is always zero or positive.

Why is the distance formula the same as the Pythagorean theorem?

Draw a right triangle whose horizontal leg is |x₂ − x₁| and whose vertical leg is |y₂ − y₁|. The segment between the points is the hypotenuse, so by a² + b² = c² the distance is √((x₂−x₁)² + (y₂−y₁)²).

Does this work for 3-D points or latitude/longitude?

This calculator is for 2-D Cartesian points. For 3-D you add a (z₂ − z₁)² term inside the square root. Latitude/longitude needs the great-circle (haversine) formula because the Earth is curved, not flat.

Sources & references

External references open in a new tab. We are independent and not affiliated with these organizations.

  • ✓ Free to use
  • ✓ No sign-up required
  • Runs entirely in your browser — nothing is uploaded.
  • ✓ Formula and method shown above

Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.

Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.

Related tools

Embed this tool on your site

Free to embed, no sign-up. Paste this code where you want the distance between two points calculator to appear: