Quick Answer: The slope of the line through (1, 2) and (5, 8) is 3/2: the line rises 6 for every 4 across. Its slope-intercept form is y = (3/2)x + 1/2, so it crosses the y-axis at 1/2.
What does this calculator do?
This slope calculator finds the slope of a straight line and writes its equation in every common form. Give it two points, or one point and a slope, and it returns the slope as an exact fraction and as a decimal, and the slope-intercept form y = mx + b.
It also gives the point-slope form, the standard form Ax + By = C with whole numbers, both intercepts, the direction of the line and the angle it makes with the x-axis.
In slope-intercept form, y = mx + b, the slope is m: the number in front of x. It tells you how much y changes when x goes up by one. The y-intercept b is where the line crosses the y-axis. Everything else about a non-vertical line follows from those two numbers.
The arithmetic is exact. Coordinates are turned into fractions before anything is divided, so a slope of two thirds is reported as 2/3, not 0.666666666666667, and the intercept carries no rounding.
Using the Slope Calculator
- Choose whether you know two points or one point and the slope.
- Enter the coordinates. Decimals and negative numbers are fine.
- Read the slope at the top and the equations below. The point-slope form uses your first point.
The presets cover a point and a slope, a whole-number slope, a horizontal line and a vertical line.
How is this calculated?
- Make the coordinates exact. Each typed decimal becomes a fraction: 2.5 is 5/2.
- Slope from two points. The rise (change in y) is divided by the run (change in x), and the fraction is reduced. If the run is zero the line is vertical and its slope is undefined. If both points are the same, they do not define a line, and the calculator says so.
m = (y₂ − y₁)/(x₂ − x₁)
- y-intercept. Substituting the first point into y = mx + b and solving gives b.
b = y₁ − m x₁
- Equations. Slope-intercept form is y = mx + b. Point-slope form is y - y₁ = m(x - x₁). Standard form is found by clearing every fraction and dividing out any common factor, so that A, B and C are whole numbers with no common factor and A is not negative.
y − y₁ = m(x − x₁); Ax + By = C
- x-intercept. Setting y = 0 gives x = -b/m. A horizontal line that is not the x-axis has no x-intercept, and a vertical line has no y-intercept unless it is the y-axis.
- Angle and direction. The angle with the positive x-axis is the arctangent of the slope, in degrees, from -90° to 90° (90° for a vertical line). A positive slope rises from left to right; a negative one falls.
Worked Example
Using the defaults, the points (1, 2) and (5, 8):
- Rise: 8 - 2 = 6. Run: 5 - 1 = 4. Rise 6 over run 4.
- Slope: 6/4 = 3/2, or 1.5.
- y-intercept: b = 2 - (3/2)(1) = 1/2, so the line crosses the y-axis at (0, 1/2).
- Slope-intercept form: y = (3/2)x + 1/2.
- Point-slope form: y - 2 = (3/2)(x - 1).
- Standard form: multiply by 2 to clear the fractions and rearrange: 3x - 2y = -1.
- x-intercept: x = -(1/2) ÷ (3/2) = (-1/3, 0).
What Is the Slope in Slope-Intercept Form?
It is the coefficient of x. In y = 2x - 4, the slope is 2 and the y-intercept is -4; that is the line through (0, -4) and (3, 2) in the presets.
A line written another way, such as 2x - y = 4, can be rearranged into slope-intercept form by solving for y, and the slope is then whatever multiplies x.
How Do You Find the y-Intercept from a Slope and a Point?
Substitute the point into y = mx + b and solve for b. The Point (2, 3), slope -0.5 preset does exactly that: 3 = (-1/2)(2) + b, so b = 4, and the line is y = (-1/2)x + 4. It crosses the x-axis at (8, 0).
Is the Slope Positive or Negative?
Read the line from left to right. If it goes up, the slope is positive; if it goes down, negative; if it stays level, the slope is zero; if it is vertical, the slope is undefined. The (-2, 5) and (4, 5) preset is horizontal, with slope 0 and equation y = 5.
The (3, 1) and (3, 7) preset is vertical: the run is zero, the slope is undefined and the equation is x = 3.
Slopes and the Angles They Make
The reference table shows how slope relates to steepness. A slope of 1 is a 45° line. A slope of 0.1, a 10% grade, is only 5.71059313749964°, while a slope of 10 is 84.2894068625004°. Slope grows without limit as a line approaches vertical, even though the angle never passes 90°.
What does this calculator not account for?
- Curves. Slope here is for straight lines. The slope of a curve changes from point to point and needs a derivative.
- Lines of best fit. Fitting a line to many scattered points is linear regression, which minimises the squared vertical distances. This calculator uses exactly two points or one point and a slope.
- Units. If x and y are measured in different units (metres and seconds), the slope has the unit of y per unit of x. The calculator works with the bare numbers.
- Percent grade. A road grade is the slope times 100: a slope of 0.25 is a 25% grade.
What mistakes do people make with this?
- Subtracting in different orders. (y₂ - y₁)/(x₂ - x₁) is right; (y₂ - y₁)/(x₁ - x₂) flips the sign.
- Putting run over rise. Slope is change in y over change in x.
- Calling a vertical line's slope zero. A horizontal line has slope zero. A vertical line has no slope at all.
- Rounding a fractional slope. 2/3 rounded to 0.67 gives a line that misses the original points slightly. Keep the fraction.
- Forgetting the sign of b. y = 2x - 4 has b = -4, not 4.
Frequently Asked Questions
How do I find the slope from two points?
What is slope-intercept form?
How do I find the slope and the intercept from an equation?
What does a slope of 0 mean?
Can a slope be a fraction?
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, section 4.1.4.1, Linear Least Squares Regression: the straight-line model with an intercept and a coefficient on x. itl.nist.gov/div898/handbook/pmd/section1/pmd141.htm
- NIST Digital Library of Mathematical Functions, section 4.23: the arctangent used for the angle of a line. dlmf.nist.gov/4.23
- OpenStax, College Algebra 2e, section 4.1, Linear Functions: slope from two points and slope-intercept form. openstax.org/books/college-algebra-2e/pages/4-1-linear-functions

