CompoundPage

Slope Calculator

The slope calculator finds the slope from two points, or a line from a point and a slope, as an exact fraction, with the slope-intercept, point-slope and standard forms, the intercepts and the angle.

Second point. Used with two points.

Used with one point and the slope.

Slope3/4

Slope m = (y2 - y1) / (x2 - x1) = (5 - 2) / (5 - 1) = 3 / 4.
3/4
Slope as a decimal
0.75
Rise and run In lowest terms, a rise of 3 for every run of 4.
rise 3, run 4
Slope-intercept form b = y1 - m x1 = 2 - (3/4)(1) = 5/4.
y = (3/4)x + 5/4
Point-slope form Using the other point gives y - 5 = (3/4)(x - 5), the same line.
y - 2 = (3/4)(x - 1)
Standard form
3x - 4y = -5
y-intercept
(0, 5/4 = 1.25)
x-intercept Set y = 0 and solve: x = -b / m = -(5/4) / (3/4) = -5/3.
(-5/3 ~ -1.6666667, 0)
Angle of inclination arctan(0.75).
36.8699°
Percent grade
75%
Perpendicular slope Parallel lines share the slope 3/4.
-4/3
Points on the line, each a run of 4 and a rise of 3 from the last
Steps from the pointxy
-2-7-4
-1-3-1
the given point12
+155
+298
+31311

How the Slope Calculator works

Slope is a single number that says how steep a straight line is and which way it leans: how far it rises for each unit it runs to the right. Pick any two points on the line, take the difference in y and divide by the difference in x. That is the whole definition, m = (y2 - y1) / (x2 - x1), and every form of the line's equation is that fraction combined with one point. Subtract in the same order on the top and the bottom; mixing the order flips the sign. A positive slope rises from left to right, a negative one falls, and a slope of zero is flat.

Zero and undefined are not the same thing, and they are worth keeping apart. A horizontal line has no rise, so its slope is 0 divided by the run, which is 0, a perfectly ordinary number. A vertical line has no run, so its slope would be a rise divided by 0, and division by zero has no answer. That is why a vertical line's equation is x = c, with no m in it at all: slope-intercept form cannot describe it. Standard form can, which is one of the reasons standard form exists.

This calculator keeps the slope as an exact fraction. The points (1, 2) and (5, 5) give a rise of 3 over a run of 4, so the slope is 3/4. The fraction is the answer; 0.75 is a decimal that happens to be tidy. Swap in a pair that gives 2/3 and the decimal is 0.666... forever, while the fraction stays exact.

The three forms of a line's equation carry the same information arranged for different jobs. Slope-intercept form, y = mx + b, is the one for graphing and reading: m is the slope and b is where the line crosses the y-axis. To find b from a point, substitute the point into y = mx + b and solve: b = y1 - m x1. Point-slope form, y - y1 = m(x - x1), needs no solving at all: you drop the slope and a point straight in, which makes it the quickest to write down and the reason it is taught. Standard form, Ax + By = C, clears the fractions by multiplying through, and by convention A, B and C are integers with no common factor and A is not negative.

The intercepts fall out of the equation. Set x = 0 to get the y-intercept, which is b. Set y = 0 to get the x-intercept, which is -b/m. A horizontal line off the axis never crosses the x-axis; a vertical line off the axis never crosses the y-axis.

Slope is also an angle in disguise. It is the tangent of the angle the line makes with the positive x-axis, so a slope of 1 is 45 degrees, and the angle of inclination is arctan(m), reported between 0 and 180 degrees. Percent grade, the figure on road signs and in ramp specifications, is slope times 100. A 100% grade is a rise equal to the run: 45 degrees, not a cliff.

Slope Calculator FAQ

How do you find the slope from two points?

Subtract the y values and divide by the difference of the x values, in the same order: m = (y2 - y1) / (x2 - x1). For (1, 2) and (5, 5) that is (5 - 2) / (5 - 1) = 3/4. Starting from the other point gives (2 - 5) / (1 - 5) = -3/-4 = 3/4, the same answer.

What is slope-intercept form?

y = mx + b, where m is the slope and b is the y-intercept, the y value where the line crosses the y-axis. Given a slope and a point, find b from b = y1 - m x1, then write the equation.

What is point-slope form?

y - y1 = m(x - x1), where (x1, y1) is any point on the line and m is its slope. It needs no solving, which is why it is the quickest way to write a line's equation from a point and a slope. Expanding it and solving for y gives slope-intercept form.

What is the slope of a vertical line?

Undefined. A vertical line has a run of zero, and a rise divided by zero has no value. Its equation is x = c. A horizontal line is different: its slope is 0 and its equation is y = c.

How do you convert to standard form?

Start from y = mx + b, multiply every term by the denominators to clear fractions, then move the x term to the left: y = (3/4)x + 5/4 becomes 4y = 3x + 5, then 3x - 4y = -5. The usual convention is integer coefficients with no common factor and a leading coefficient that is not negative.

What is the perpendicular slope?

The negative reciprocal: flip the fraction and change the sign, so 3/4 becomes -4/3. Perpendicular slopes multiply to -1. A horizontal line (slope 0) is perpendicular to a vertical line (undefined slope), the one case the rule does not cover.

Related calculators

Embed this calculator
<div id="compoundpage-slope-calculator"></div>
<script src="https://compoundpage.com/embed/slope-calculator.js" async></script>

The same calculation as JSON