Free algebra tool
Slope & Line Equation Calculator
Find the slope of a line from two points, and write its equation in slope-intercept (y = mx + b), point-slope and standard form, with exact fractions and every step shown. Start from a point and a slope, or a slope and y-intercept, instead. Drag the points on the graph to watch rise over run change, and get the intercepts, distance and midpoint too. Free, no signup.
Slope-intercept y = \frac{5}{3}x + \frac{1}{3}
Point-slope y - 2 = \frac{5}{3}(x - 1)
Standard form 5x - 3y = -1
Drag the points (they snap to whole numbers). Blue dashes: the run; green: the rise.
Slope
y-intercept
x-intercept
Parallel and perpendicular slopes
Distance between the points
Midpoint
Step by step
- 1Slope is rise over run: the change in y divided by the change in x.m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{7 - 2}{4 - 1} = \frac{5}{3}
- 2Put one point into y = mx + b to find b, the y-intercept.2 = \frac{5}{3} \cdot 1 + b \;\Rightarrow\; b = \frac{1}{3}
- 3Standard form moves x and y to one side with whole-number coefficients.5x - 3y = -1
The slope formula
Keep the points in the same order on top and bottom. If you swap both, the answer doesn't change; if you swap only one, the sign flips, which is the most common slope mistake.
Three forms of the same line
- Slope-intercept: y = mx + b. Read the slope and the y-intercept straight off; best for graphing.
- Point-slope: y - y₁ = m(x - x₁). The quickest to write when you know a point and the slope.
- Standard: Ax + By = C with whole numbers. Handy for finding intercepts and for systems of equations.
Frequently asked questions
How do you find the slope between two points?+
Subtract the y-values and divide by the difference of the x-values, in the same order: m = (y₂ - y₁) ÷ (x₂ - x₁). For (1, 2) and (4, 7) that is (7 - 2) ÷ (4 - 1) = 5/3. It is often described as rise over run.
How do you write the equation of a line from two points?+
Find the slope m first, then put it and either point into y = mx + b and solve for b. Or write it straight away in point-slope form, y - y₁ = m(x - x₁). The calculator shows both, plus standard form Ax + By = C.
What is the slope of a vertical or horizontal line?+
A horizontal line has slope 0 (no rise), so its equation is y = a number. A vertical line has an undefined slope, because the run is 0 and you can't divide by zero; its equation is x = a number.
What are parallel and perpendicular slopes?+
Parallel lines have the same slope. Perpendicular lines have slopes that are negative reciprocals, so their product is -1: a line with slope 2/3 is perpendicular to one with slope -3/2.
Can I enter fractions and decimals?+
Yes. Type 2/3, 0.75 or -4 in any box. The answers are kept as exact fractions, so 0.75 becomes 3/4 instead of a rounded decimal.
Working on linear equations?
Graph any equation next, or get an algebra tutor to make slope click, one-on-one. Your first trial lesson is free.
Make algebra make sense
A 1-on-1 algebra tutor builds confidence with slope, lines and graphs. Your first trial lesson is free.