Distance, Midpoint & Slope Calculator

Distance

5.0000

The Numbers

  • Midpoint: (2.5000, 4.0000)
  • Slope: 1.3333

Compare Calculations

Downloads

Includes your inputs and results for this calculation, plus any additional calculations you've compared.

How This Calculator Works

Given two points on a coordinate plane, three related quantities describe how they relate: how far apart they are (distance), the point exactly between them (midpoint), and how steep the line connecting them is (slope). Enter both points’ x and y coordinates, and this calculator finds all three at once.

The Formulas

  • Distance: (x2x1)2+(y2y1)2\sqrt{(\vB{x_2} - \vA{x_1})^2 + (\vB{y_2} - \vA{y_1})^2} — the Pythagorean theorem applied to the horizontal and vertical gaps between the two points.
  • Midpoint: (x1+x22,y1+y22)\left(\frac{\vA{x_1} + \vB{x_2}}{2}, \frac{\vA{y_1} + \vB{y_2}}{2}\right) — the average of the two x-coordinates and the average of the two y-coordinates.
  • Slope: y2y1x2x1\frac{\vB{y_2} - \vA{y_1}}{\vB{x_2} - \vA{x_1}} — “rise over run.” Undefined when both points share the same x-coordinate (a perfectly vertical line has no defined slope).

Worked Example

Point A at (1, 2) and Point B at (4, 6):

  1. Distance: (41)2+(62)2=9+16=25=5\sqrt{(\vB{4} - \vA{1})^2 + (\vB{6} - \vA{2})^2} = \sqrt{9 + 16} = \sqrt{25} = 5
  2. Midpoint: (1+42,2+62)=(2.5,4)\left(\frac{\vA{1} + \vB{4}}{2}, \frac{\vA{2} + \vB{6}}{2}\right) = (2.5, 4)
  3. Slope: 6241=431.33\frac{\vB{6} - \vA{2}}{\vB{4} - \vA{1}} = \frac{4}{3} \approx 1.33

Source: Standard Coordinate Geometry.

Frequently Asked Questions

Why are distance, midpoint, and slope combined into one calculator?

All three are computed from the exact same two points, so it's more useful to see them together than to look them up on three separate pages — you enter your coordinates once and get every commonly-needed answer at once.

What does an undefined slope mean?

A vertical line (where both points share the same x-coordinate) has no defined slope, since the slope formula would require dividing by zero. This calculator reports "Undefined (vertical line)" in that case rather than an error or a meaningless number.

What is the midpoint used for?

The midpoint is the exact center point between two coordinates — useful for finding the center of a line segment, splitting a distance evenly, or as a step in other geometry problems like finding a perpendicular bisector.