Distance Between Two Points Calculator: Your Math Helper

Calculate the distance between two points, find their midpoint, and determine the slope of the line connecting them.

Point 1 Coordinates:

Point 2 Coordinates:

Results:

Distance:

Midpoint:

Slope:

Practical Example:

GPS Navigation: If you're at position (3, 4) and need to reach (7, 10):

  • Distance = 7.21 units (could be miles or kilometers)
  • Midpoint (5, 7) = halfway point for a rest stop
  • Slope = 1.5 = for every 1 unit east, you travel 1.5 units north

Try these coordinates above to see the calculations!

Three related calculations from two points

Given two coordinate pairs, the tool computes the straight-line distance (via the Pythagorean theorem), the midpoint (the simple average of each coordinate), and the slope of the line connecting them — all from the same four input values.

Worked example

Take point 1 at (-2, 3) and point 2 at (4, -5). The differences are Δx = 4 - (-2) = 6 and Δy = -5 - 3 = -8. Distance = √(6² + (-8)²) = √(36 + 64) = √100 = 10 — a clean 3-4-5 triangle scaled by 2 (6-8-10), which is why it lands on a whole number instead of a messy decimal. Midpoint = ((-2+4)/2, (3+(-5))/2) = (1, -1). Slope = Δy/Δx = -8/6 = -1.3333, meaning the line drops about 1.33 units for every 1 unit it moves right.

Vertical and horizontal cases

If both points share the same x-coordinate (Δx = 0), the slope is mathematically undefined — dividing by zero — and the tool reports "Undefined (vertical line)" instead of an error. If both share the same y-coordinate, the slope is exactly 0 and the tool labels it "0 (horizontal line)" for clarity.

Where this is used

This combination of distance, midpoint, and slope covers the basics needed for coordinate geometry proofs, GPS-style distance-between-waypoints estimates on a flat plane (not accounting for Earth's curvature), and setting up the equation of a line through two known points.

Constraints

All four coordinate fields must contain a number; the tool does not accept blank fields and will not silently treat them as zero.