SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call

Slope, Distance & Midpoint Calculator

Enter two points to get the slope, the distance between them (exact and decimal), the midpoint, the angle of the line and its equation in slope-intercept and standard form, with the formulas filled in with your numbers.

Free, no signupNo daily limitRuns in your browser - nothing you enter is uploadedUpdated

Point 1
Point 2
-Slope m
-Distance
-Midpoint
-Angle with the x-axis
The two points, the midpoint (amber) and the line through them.

The four formulas

WhatFormulaFor (1, 2) and (4, 6)
Slopem = (y₂ − y₁) ÷ (x₂ − x₁)(6 − 2) ÷ (4 − 1) = 4/3
Distanced = √((x₂ − x₁)² + (y₂ − y₁)²)√(9 + 16) = √25 = 5
Midpoint((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)(2.5, 4)
Liney = mx + b, b = y₁ − m·x₁b = 2 − 4/3 = 2/3 → y = 4/3x + 2/3

Worked example: (1, 2) and (4, 6)

  1. Change in x and yΔx = 4 − 1 = 3, Δy = 6 − 2 = 4
  2. Slopem = Δy ÷ Δx = 4/3 ≈ 1.3333
  3. Distance (a 3-4-5 triangle)d = √(3² + 4²) = √25 = 5
  4. Intercept and equationb = 2 − (4/3)(1) = 2/3 → y = 4/3x + 2/3
  5. Standard form (multiply by 3)4x − 3y = −2

What the slope means

Slope is rise over run: how much y changes for every 1 step in x. A slope of 4/3 means the line climbs 4 units for every 3 units to the right.

  • Positive slope: the line rises from left to right.
  • Negative slope: it falls.
  • Zero: a horizontal line, y = a constant.
  • Undefined: a vertical line, x = a constant, because Δx = 0.

Parallel lines have equal slopes, and perpendicular lines have slopes that multiply to −1 (4/3 and −3/4).

What this calculator does not do

  • Two points in a plane (2D) only.
  • Coordinates can be whole numbers, decimals or fractions; decimals are limited to 12 decimal places.
  • The sketch shows the direction of the line; it is not a graphing tool.

Frequently asked questions

How do you find the slope between two points?
Slope m = (y₂ − y₁) ÷ (x₂ − x₁), the change in y divided by the change in x. From (1, 2) to (4, 6) the slope is (6 − 2) ÷ (4 − 1) = 4/3.
What is the slope of a vertical line?
Undefined. A vertical line has no change in x, so the slope formula would divide by zero. Its equation is x = a number, such as x = 2.
How do you find the distance between two points?
Use d = √((x₂ − x₁)² + (y₂ − y₁)²), which is Pythagoras' theorem. From (1, 2) to (4, 6): √(3² + 4²) = √25 = 5.
How do you find the midpoint?
Average the x-values and average the y-values: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2). For (1, 2) and (4, 6) the midpoint is (2.5, 4).
How do I write the equation of the line?
Slope-intercept form is y = mx + b, where b = y₁ − m × x₁. Standard form Ax + By = C uses whole numbers; the calculator gives both.
What is the angle of the line?
The angle the line makes with the positive x-axis, measured anticlockwise from 0° to 180°. It equals the inverse tangent of the slope.