Maths / Graphs
Slope Calculator (from Two Points)
Find the slope of the line through two points as a decimal and an exact fraction, with the equation y = mx + b, both intercepts, the angle to the x-axis, the percentage grade, the distance between the points, and a plot.
Slope Calculator (from Two Points): Slope is rise over run, m = (y₂ − y₁) ÷ (x₂ − x₁); through (1, 2) and (4, 8), m = 6 ÷ 3 = 2. The intercept b = y₁ − m·x₁ gives the equation y = 2x + 0. The angle with the x-axis is arctan(m), 63.43°, and the grade is m × 100%. A vertical line, where x₂ = x₁, has no defined slope and is written x = constant. Runs 100% locally in your browser with zero server file uploads.
- Category
- School & study tools
- Runs
- In your browser
- Cost
- Free · no sign-up
- Availability
- Ready to use
Runs entirely in your browser
Slope is rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁). The line then passes through both points as y = mx + b, with b = y₁ − m·x₁. A positive slope rises to the right, zero is horizontal, and a vertical line has no defined slope. As a percentage grade, used for roads and ramps, it is m × 100.
Worked example
Through (2, 3) and (5, −3): m = (−3 − 3) ÷ (5 − 2) = −2, b = 3 − (−2 × 2) = 7, so y = −2x + 7, crossing the x-axis at 3.5.
To plot the line or several functions, use the graphing calculator.
Slope and real data
A slope through just two points can mislead when the data are noisy; fitting a line through all the points by least squares gives a better estimate.
The linear regression calculator does that, and the midpoint calculator finds the point halfway between two.
How to use it
- Enter the coordinates of the two points.
- Read the slope, the equation, and the intercepts.
- Check the angle, grade, and distance, and the plot.
Privacy & limitations
Everything is calculated in your browser.
Related tools
Frequently asked questions
What does a negative slope mean?
The line falls from left to right: through (2, 3) and (5, −3) the slope is −2, so y drops 2 for every 1 step in x.
How do I find a perpendicular line?
Its slope is the negative reciprocal, −1 ÷ m: perpendicular to a slope of 2 is −½.
What is the difference between slope and grade?
Grade is the slope as a percentage, used for roads and ramps: a slope of 0.08 is an 8% grade, rising 8 m over 100 m.
Free tool · runs in your browser · no account required