Slope Calculator
Find the slope between two points (x1,y1) and (x2,y2) as an exact reduced fraction, plus point-slope, slope-intercept, and standard line equations.
The slope formula
The slope of the line through and is:
This is "rise over run": is how far the line rises (or falls) vertically, and is how far it runs horizontally, between the two points.
Two special cases
- Horizontal line (): the slope is exactly — never changes.
- Vertical line (): the slope is undefined — division by zero has no value. A vertical line's equation is simply .
These are opposite situations, not the same: a slope is a perfectly real, flat line; an undefined slope means there is no single rate of rise per unit of run, because the run itself is zero.
Three equations for the same line
Once the slope and a point are known, the line can be written three ways:
Point-slope form:
Slope-intercept form: solve point-slope for to get , where is the -intercept.
Standard form: clear the fractions in slope-intercept form and move every term to one side: , with , , integers, , and no common factor other than .
Worked example
For and : and , so .
Point-slope through : .
Solving for : (so ).
Clearing denominators: .
The line crosses the -axis at and the -axis at — found by setting (giving ) and (giving ) in slope-intercept form.
Parallel and perpendicular slopes
A line parallel to this one has the identical slope . A line perpendicular to it has the negative reciprocal slope — for , that's . A horizontal line () is perpendicular to a vertical one (undefined slope), and vice versa.
Related calculators
The same two points also determine the Distance Between Two Points between them (the straight-line length of the segment) — this calculator instead finds how steep that segment is, and every equation of the line through it. Slope and the Quadratic Formula both describe curves from their coefficients; a line is simply the degree-1 case ( and instead of , , and ).
Frequently asked questions
- What is the slope formula?
- The slope of the line through and is — "rise over run": how much changes for every unit changes.
- Why is the slope of a vertical line undefined?
- A vertical line has , so . The slope formula would divide by zero, which has no value — so the slope is undefined (does not exist), not zero. A vertical line still has a perfectly good equation, just not a "" one: it is for every point on it.
- What is the difference between a slope of 0 and an undefined slope?
- A slope of means a horizontal line (, never changes as moves). An undefined slope means a vertical line (, never changes). These are opposite, not the same thing — mixing them up is one of the most common slope mistakes.
- How do I find the equation of a line from two points?
- First find the slope . Then plug and either point into point-slope form . Solving that for gives slope-intercept form ; clearing the fractions and moving everything to one side gives standard form . All three describe the exact same line.
- What is the slope of a line parallel to this one?
- Exactly the same slope, . Parallel lines never meet, which is only possible if they rise and run at the identical rate — any two distinct lines with the same slope are parallel.
- What is the slope of a line perpendicular to this one?
- The negative reciprocal, — flip the fraction and flip the sign. For example a slope of pairs with a perpendicular slope of . When (horizontal), the perpendicular line is vertical, so its slope is undefined; when is undefined (vertical), the perpendicular line is horizontal, with slope .
- How is the standard form Ax + By = C chosen — couldn't the same line be written many ways?
- Yes — multiplying every term by any nonzero constant gives an equivalent equation. This calculator picks the one canonical version: , , are integers with no common factor other than , and , so every line has exactly one standard-form answer instead of infinitely many equally-valid ones.