Slope Calculator
Enter two points to find the slope of a line using rise over run — plus the y-intercept, slope-intercept equation, angle of incline, distance, and midpoint, with every step shown.
- 01Find the slope of a line from two points instantly with the slope formula m = (y₂ − y₁) / (x₂ − x₁).
- 02Get the y-intercept and the slope-intercept form equation y = mx + b automatically.
- 03See rise over run, the angle of incline in degrees, distance, and the midpoint in one click.
- 04Handles vertical lines (undefined slope), horizontal lines, decimals, and negative coordinates.
- 05100% free and private — every calculation runs in your browser.
Slope Calculator
Enter two points on the line
Point 1 (x₁, y₁)
Point 2 (x₂, y₂)
Try an example pair of points
Slope (m)
2
Rise over run between the two points
Line Equation
y = 2x
Slope-intercept form y = mx + b
Rise (Δy)
6
Run (Δx)
3
Angle of Incline
63.434949°
y-intercept (b)
0
Distance
6.708204
Midpoint
(2.5, 5)
Point-slope form
y − 2 = 2(x − 1)
Direction
Increasing (uphill)
Step-by-step calculation
- 01Points: (x₁, y₁) = (1, 2) and (x₂, y₂) = (4, 8)
- 02Rise (vertical change) Δy = y₂ − y₁ = 8 − 2 = 6
- 03Run (horizontal change) Δx = x₂ − x₁ = 4 − 1 = 3
- 04Slope m = rise ÷ run = 6 ÷ 3 = 2
- 05y-intercept b = y₁ − m·x₁ = 2 − (2)(1) = 0
- 06Slope-intercept equation: y = 2x
Why Use This Slope Calculator
Slope From Two Points
Enter the coordinates of any two points and the slope calculator finds the slope of the line instantly using the slope formula m = (y₂ − y₁) / (x₂ − x₁). It is the fastest way to find the slope, or gradient, of a line between two points.
Full Line Equation
Beyond the slope, you get the y-intercept and the complete slope-intercept form equation y = mx + b, plus the point-slope form y − y₁ = m(x − x₁). Use it as a line equation calculator for graphing, algebra homework, and geometry.
Rise Over Run, Visualized
The calculator breaks the slope down into rise (the vertical change, Δy) and run (the horizontal change, Δx), so you can see exactly how rise over run produces the slope value — perfect for learning and for checking your own work.
Angle, Distance and Midpoint
Get the angle of incline in degrees from atan(m), the straight-line distance between the two points, and the midpoint of the segment. One tool covers slope, the line equation, the angle, distance, and midpoint together.
Handles Every Case
Vertical lines return an undefined slope, horizontal lines return a slope of zero, and decimals and negative coordinates are fully supported. No edge case is left out, so the answer is always correct.
Instant, Free and Private
Everything runs in your browser with no server round-trips, no signup, and no limits. Your coordinates never leave your device, and results appear the moment you press Calculate.
What Is the Slope of a Line?
The slope of a line measures how steep it is — how much it rises or falls for each step you take to the right. It is defined as the change in y (the rise) divided by the change in x (the run) between any two points on the line. A larger slope means a steeper line, a slope of zero means a horizontal line, and a vertical line has an undefined slope.
Whether you are a student learning algebra, plotting a line on a graph, or working out a ramp or road gradient, this slope calculator gives instant, step-by-step results for any two points.
- The Slope Formula
- Given two points (x₁, y₁) and (x₂, y₂), the slope is m = (y₂ − y₁) / (x₂ − x₁), often remembered as rise over run. This slope of a line calculator applies the formula for you and shows each step so you can follow the working.
- Positive, Negative, Zero and Undefined Slope
- A positive slope rises from left to right (uphill), a negative slope falls from left to right (downhill), a horizontal line has a slope of zero, and a vertical line has an undefined slope because the run (Δx) is zero, which would mean dividing by zero.
- From Slope to the Line Equation
- Once you know the slope, the slope-intercept form y = mx + b describes the whole line, where b is the y-intercept (b = y₁ − m·x₁). The point-slope form y − y₁ = m(x − x₁) is another way to write the same line using the slope and one point.
- Slope as an Angle and a Rate
- The slope is also the tangent of the line's angle of incline, so the angle equals arctan(m) in degrees. In real-world terms, slope is a rate of change — miles per hour, cost per unit, or rise per metre on a ramp or road grade.
How to Use the Slope Calculator
- 01
Enter the first point
Type the coordinates of your first point into the x₁ and y₁ fields. Decimals and negative numbers are supported, so you can use any two points on the line.
- 02
Enter the second point
Type the coordinates of your second point into the x₂ and y₂ fields. The two points must be different; if x₂ equals x₁ the line is vertical and the slope is undefined.
- 03
Click Calculate
Press the Calculate button. The tool applies the slope formula m = (y₂ − y₁) / (x₂ − x₁) and instantly returns the slope, y-intercept, line equation, angle, distance, and midpoint.
- 04
Read the results and steps
The headline cards show the slope and the slope-intercept equation. Below them you get rise, run, the angle of incline, the y-intercept, distance, and midpoint, plus a step-by-step breakdown of rise over run for learning and checking homework.
Tips for Finding the Slope of a Line
Keep the Points in Order
Subtract the coordinates in the same order in both the numerator and denominator: (y₂ − y₁) ÷ (x₂ − x₁). Swapping the order in only one of them flips the sign and gives the wrong slope.
Watch for Vertical Lines
If the two x-coordinates are equal, the run is zero and the slope is undefined — the line is vertical. This is the most common trap, because dividing by zero is not allowed. The calculator flags it for you.
Mind the Signs
Negative coordinates and downhill lines produce negative slopes. Track the signs of the rise and run carefully; a negative slope means the line falls from left to right.
Reduce the Fraction
Slope is often clearest as a simplified fraction or a decimal. A slope of 4/2 is the same as 2, and 6/8 simplifies to 3/4 — reducing makes the rise over run easier to read on a graph.
Use Slope-Intercept Form to Graph
Once you have m and the y-intercept b, plot the point (0, b) and use the slope as rise over run to step to the next point. Slope-intercept form y = mx + b is the quickest way to graph a line by hand.
Remember Parallel and Perpendicular Rules
Parallel lines share the same slope, while perpendicular lines have slopes that are negative reciprocals (their product is −1). Knowing the slope lets you check these relationships instantly.
Slope Formulas and Definitions
Definition of slope
Slope (also called gradient) measures the steepness and direction of a line. It is the ratio of the vertical change (rise) to the horizontal change (run) between two points, written as m = rise ÷ run.
What the slope tells you
- How steep a line is — larger absolute values mean a steeper line.
- The direction of the line — positive slopes go uphill, negative slopes go downhill.
- The rate of change of y with respect to x, such as speed, cost per unit, or road grade.
- Whether two lines are parallel (equal slopes) or perpendicular (negative reciprocal slopes).
Special cases of slope
A horizontal line has a slope of zero, and a vertical line has an undefined slope because its run is zero. Both are handled automatically by this calculator.
Key Slope and Line Formulas
Slope (two points)
m = (y₂ − y₁) / (x₂ − x₁)
Example: from (1, 2) to (4, 8), m = (8 − 2) / (4 − 1) = 2.
Rise over run
m = rise ÷ run = Δy ÷ Δx
The vertical change divided by the horizontal change.
Slope-intercept form
y = mx + b
b is the y-intercept, where the line crosses the y-axis.
Point-slope form
y − y₁ = m(x − x₁)
Uses the slope and one known point on the line.
y-intercept
b = y₁ − m·x₁
Solve for b once the slope and a point are known.
Angle of incline
θ = arctan(m)
A slope of 1 gives a 45° angle from the x-axis.
Distance between points
d = √((x₂ − x₁)² + (y₂ − y₁)²)
The straight-line length of the segment.
Midpoint
M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2)
The point exactly halfway between the two points.
Slope Calculator FAQ
Q01How do I find the slope of a line from two points?
Use the slope formula m = (y₂ − y₁) / (x₂ − x₁). Subtract the y-coordinate of the first point from the y-coordinate of the second to get the rise, subtract the x-coordinates in the same order to get the run, then divide the rise by the run. This calculator does all of those steps for you and shows the working.
Q02What is the slope formula?
The slope formula is m = (y₂ − y₁) / (x₂ − x₁), where (x₁, y₁) and (x₂, y₂) are two points on the line. It is commonly described as rise over run: the vertical change (rise) divided by the horizontal change (run).
Q03What does rise over run mean?
Rise over run is the vertical change between two points (the rise, Δy) divided by the horizontal change between them (the run, Δx). It is exactly the same as the slope, so slope = rise ÷ run. A rise of 6 over a run of 3 gives a slope of 2.
Q04What is the slope of a vertical line?
A vertical line has an undefined slope. Because the two points share the same x-coordinate, the run (Δx) is zero, and dividing by zero is not defined. This calculator detects vertical lines and reports the slope as undefined.
Q05What is the slope of a horizontal line?
A horizontal line has a slope of zero. The two points share the same y-coordinate, so the rise (Δy) is zero, and zero divided by the run is zero. Its equation is simply y = b, where b is the constant y-value.
Q06How do I find the y-intercept and the equation of the line?
After finding the slope m, calculate the y-intercept with b = y₁ − m·x₁ using one of your points. The line is then written in slope-intercept form as y = mx + b. The calculator returns both the y-intercept and the full equation, plus the point-slope form y − y₁ = m(x − x₁).
Q07How is the angle of a line related to its slope?
The slope equals the tangent of the line's angle of incline, so the angle is arctan(m), measured from the positive x-axis. A slope of 1 corresponds to a 45° angle. This tool reports the angle in degrees alongside the slope.
Q08Is this slope calculator free?
Yes, it is completely free with no limits, no signup, and no premium tier. It runs entirely in your browser, so your coordinates are never uploaded, and you can find the slope of as many lines as you like.