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.
-Slope m
-Distance
-Midpoint
-Angle with the x-axis
The four formulas
| What | Formula | For (1, 2) and (4, 6) |
|---|---|---|
| Slope | m = (y₂ − y₁) ÷ (x₂ − x₁) | (6 − 2) ÷ (4 − 1) = 4/3 |
| Distance | d = √((x₂ − x₁)² + (y₂ − y₁)²) | √(9 + 16) = √25 = 5 |
| Midpoint | ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2) | (2.5, 4) |
| Line | y = mx + b, b = y₁ − m·x₁ | b = 2 − 4/3 = 2/3 → y = 4/3x + 2/3 |
Worked example: (1, 2) and (4, 6)
- Change in x and y
Δx = 4 − 1 = 3, Δy = 6 − 2 = 4 - Slope
m = Δy ÷ Δx = 4/3 ≈ 1.3333 - Distance (a 3-4-5 triangle)
d = √(3² + 4²) = √25 = 5 - Intercept and equation
b = 2 − (4/3)(1) = 2/3 → y = 4/3x + 2/3 - 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.
Related free tools
📐
Quadratic Formula CalculatorExact roots of ax² + bx + c = 0 (radicals, complex), vertex and factored form.
🧩System of Equations SolverSolve 2×2 and 3×3 linear systems exactly, with every determinant shown.
➗Fraction CalculatorAdd, subtract, multiply, divide and simplify fractions, with each step shown.
💯Percentage CalculatorX% of Y, percent of a total, increase/decrease, add or remove a percent, and marks.
Step-by-step guide: How to find the slope between two points →