Slope Calculator
: Find the slope and equation of a line from two points, a point and slope or an equation, with intercepts, the angle and percent grade, worked exactly- Slope (m)
- 3/2 = 1.5
- Slope-intercept form
- y = (3/2)x + 1/2
- In decimals: y = 1.5x + 0.5
- Point-slope form
- y - 2 = (3/2)(x - 1)
- y - y₁ = m(x - x₁) through (1, 2).
- Standard form
- 3x - 2y = -1
- Ax + By = C in whole numbers. General form: 3x - 2y + 1 = 0
- Rise (Δy)
- 6
- y₂ - y₁ = 8 - 2
- Run (Δx)
- 4
- x₂ - x₁ = 5 - 1
- Direction
- Rising
- Up 3 for every 2 to the right.
- Angle
- 56.3099°
- arctan(1.5) in degrees (0.982794 rad), above the horizontal. This is also the angle of inclination.
- Percent grade
- 150%
- Rise ÷ run × 100: how far it climbs for every 100 across.
- Ratio (rise : run)
- ≈ 1 : 0.666667
- 1 up (or down) for every about 0.666667 across. In whole numbers 3 : 2.
- y-intercept
- (0, 0.5)
- b = 1/2 = 0.5: where the line crosses the y-axis.
- x-intercept
- (-1/3, 0)
- Where y = 0: x = -1/3 ≈ -0.333333.
- Perpendicular slope
- -2/3 ≈ -0.666667
- -1 ÷ m. Through (1, 2): y = -(2/3)x + 8/3. A parallel line has the same slope, 3/2.
- Distance between the points
- √52 ≈ 7.2111
- √(run² + rise²) = √(4² + 6²).
- Midpoint
- (3, 5)
- Halfway between the two points: ((x₁ + x₂) / 2, (y₁ + y₂) / 2).
- Working
- m = (y₂ - y₁) / (x₂ - x₁) = (8 - 2) / (5 - 1) = 6 / 4 = 3/2 = 1.5 b = y₁ - m × x₁ = 2 - (3/2) × 1 = 1/2
Slope Calculator
A slope calculator that finds the slope of a line from two points, from a point and a slope, from a typed equation, or from a rise and run, percent grade, angle or ratio. With the slope it gives the equation of the line in slope-intercept, point-slope and standard form, the y- and x-intercepts, the angle, the percent grade, the perpendicular slope and the working with your numbers. Fractions stay exact, so a slope of 2/3 is shown as 2/3, not 0.6666666667.
How to find the slope of a line
- Pick how you know the line beside
Line(buttons on a computer, a drop-down on a phone):Two points,Point and slope,Equation, orRise and run, %, angleto convert between slope forms. - Type the numbers. Coordinates and slopes take whole numbers, decimals, negatives and fractions (
3/4,-1 1/2). An equation can be in any linear form:y = 2x + 3,y = -x/2 + 1,2x + 3y = 6,3x - 4y + 12 = 0orx = 5. - Read
Slope (m)andSlope-intercept format the top, then the other forms, the intercepts, the angle and the percent grade.Workingshows each step with your numbers, and the triangle below the figures draws the rise over the run. Copy allorDownloadkeeps every figure. A marked field says what is wrong with it, such as two points that are the same.
Example
The slope and equation of the line through (1, 2) and (5, 8).
x₁: 1
y₁: 2
x₂: 5
y₂: 8Slope (m): 3/2 = 1.5
Slope-intercept form: y = (3/2)x + 1/2
Point-slope form: y - 2 = (3/2)(x - 1)
Standard form: 3x - 2y = -1
Angle: 56.3099°
Percent grade: 150%
y-intercept: (0, 0.5)
x-intercept: (-1/3, 0)
Perpendicular slope: -2/3 ≈ -0.666667
Distance between the points: √52 ≈ 7.2111
Midpoint: (3, 5)
Working:
m = (y₂ - y₁) / (x₂ - x₁)
= (8 - 2) / (5 - 1)
= 6 / 4
= 3/2 = 1.5
b = y₁ - m × x₁ = 2 - (3/2) × 1 = 1/2Details
- Slope, also called the gradient, is rise over run: how far the line goes up (Δy) for each step across (Δx). From two points, m = (y₂ - y₁) / (x₂ - x₁). For (1, 2) and (5, 8) the rise is 6 and the run 4, so the slope is 3/2 = 1.5. A line that goes down to the right has a negative slope: (0, 5) to (4, 1) gives -1.
- The equation of a line comes in three forms. Slope-intercept form, y = mx + b, shows the slope m and the y-intercept b: here y = (3/2)x + 1/2. Point-slope form, y - y₁ = m(x - x₁), is built from one point and the slope: y - 2 = (3/2)(x - 1). Standard form, Ax + By = C, uses whole numbers with no common factor and A not negative: 3x - 2y = -1. All three describe the same line; standard form also gives the general form, Ax + By + C = 0.
- Point and slope: give one point and m to get the line's equation. The point (2, -1) with a slope of 3/4 gives y = (3/4)x - 5/2 and 3x - 4y = 10, and (6, 2) is another point on it.
- Slope from an equation: type the equation as you have it and the calculator rearranges it.
3x - 4y + 12 = 0becomes 3x - 4y = -12, then y = (3/4)x + 3, so the slope is 3/4 = 0.75 and the y-intercept (0, 3). It reads terms on either side, brackets, decimals and fractions;1/2xis read as (1/2)x. Anything that is not a straight line is refused with the reason, such as x² or xy. - Percent grade is the slope times 100, and the angle is arctan(m) in degrees. A slope of 3/4 is 75% and 36.8699°; an 8% grade is a slope of 2/25 = 0.08 and an angle of 4.5739°, and climbs 8 over a run of 100. Going from degrees to percent uses the tangent: 30° is ≈ 57.735%. Percent and degrees are not the same scale: 100% is 45°, and a vertical line has no percent at all.
- Negative angles: a falling line is shown with its angle below the horizontal, such as -45° for a slope of -1, and with its angle of inclination, 135°, measured counter-clockwise from the positive x-axis as maths classes use it. Both describe the same line.
- Vertical and horizontal lines: when x₁ = x₂ the run is 0, and because nothing can be divided by 0 the slope of a vertical line is undefined. The calculator says so in words and gives the equation x = 3, an angle of 90° and no y-intercept. A horizontal line has a slope of 0, an equation such as y = 4, no x-intercept unless it is the x-axis, and a vertical perpendicular.
- Perpendicular and parallel lines: a parallel line has the same slope; a perpendicular line has the negative reciprocal, -1 ÷ m, so the two slopes multiply to -1. For the slope 3/2 that is -2/3 ≈ -0.666667. The two-point mode also gives the distance between the points and the midpoint.
Limits
- Straight lines in two dimensions only. It does not find the slope of a curve at a point (a derivative), fit a line through many points (linear regression) or work with lines in 3D.
- It does not plot the line on a graph; the triangle drawn under the figures shows only the rise and run between two points of it.
- An equation must be linear in x and y, with one equals sign. Powers of x or y, x times y, x or y under a fraction line, other letters and inequalities are refused with the reason.
- Numbers have at most 30 digits. Results are exact fractions; angles, distances that are not whole square roots and slopes from an angle (other than multiples of 45°) are rounded and marked ≈. Two equal points are refused: "The two points are the same. A line needs two different points; change x₂ or y₂."
FAQ
How do you find the slope from two points?
Subtract the y values and the x values in the same order and divide: m = (y₂ - y₁) / (x₂ - x₁). For (1, 2) and (5, 8) that is (8 - 2) / (5 - 1) = 6/4, which reduces to 3/2 = 1.5.
How do you convert slope to percent and to degrees?
Percent grade is the slope × 100; the angle is arctan(slope). A slope of 3/4 is 75% and 36.8699°. Going from degrees to percent, take the tangent and multiply by 100: 30° is ≈ 57.735%. The same rise over run, percent and angle apply to a roof, a ramp or a road.
What is point-slope form?
y - y₁ = m(x - x₁), the equation of a line written from one point (x₁, y₁) and the slope m. The point (2, -1) with slope 3/4 gives y + 1 = (3/4)(x - 2); solved for y it is y = (3/4)x - 5/2.
What is the slope of a vertical line?
Undefined. A vertical line has a run of 0, and dividing the rise by 0 has no value. Its equation is x = c (through (3, 1) and (3, 7) it is x = 3); a horizontal line, by contrast, has a slope of 0.
How do you find the slope and y-intercept from an equation?
Solve the equation for y to get y = mx + b; m is the slope and b the y-intercept. For 3x - 4y + 12 = 0 that is y = (3/4)x + 3: slope 3/4 = 0.75, crossing the y-axis at (0, 3). The Equation mode does this for you and shows the steps.
Runs entirely in your browser. Nothing is uploaded.