Slope Calculator

Use this slope calculator with two points, one point and a slope, y = mx + b, or Ax + By = C. You'll get the exact slope as a fraction, the line in slope intercept, point slope and standard form, both intercepts, the angle, percent grade and the parallel and perpendicular slopes.

Calculation and content reviewed by EZ Calculators Editorial Team on .

Enter values

Choose the line information you already have. Exact fractions stay exact while the result converts the same line into useful equation forms, intercepts, angle, grade, and geometric checks.

Build the scenario below, then calculate for a complete result report.

Runs in your browser
Choose the information given
Starting form(x1, y1) and (x2, y2)

Point 1

Enter an integer, terminating decimal, fraction, or bounded scientific notation.
Keep the coordinate paired with the x-value beside it.

Point 2

A matching x-value produces a vertical line unless both points are identical.
Subtract coordinates in the same point order.
Controls rounded decimal displays; exact fractions and equation checks remain unchanged.
Exact line first, rounded geometry secondFractions remain exact through every equation conversion and coordinate check.
Use signed integers, terminating decimals, fractions such as -3/4, or scientific notation such as 1.2e3. Angle, distance, and percent grade are rounded displays. Grade is meaningful only when horizontal and vertical measurements use comparable units.

What is the slope formula?

Slope is rise over run: m = (y2 - y1) / (x2 - x1). Subtract the y-values, subtract the x-values in the same order, and divide. For the points (1, 2) and (5, 10), the rise is 10 - 2 = 8 and the run is 5 - 1 = 4, so the slope is 8 / 4 = 2. If the run is zero, the line is vertical and the slope is undefined.

How to use the slope calculator

Pick what you already know from the Starting information menu, then fill in only those boxes. You can type whole numbers, decimals, fractions like -3/4 or scientific notation like 1.2e3. Fractions stay exact, so a slope of 2/3 is shown as 2/3, not 0.666667.

The decimal precision setting only changes the rounded numbers, like the angle and the distance between points. The slope, intercepts and equations are always exact.

  1. Choose Two points, One point and slope, Slope-intercept form or Standard form.
  2. Enter the coordinates, slope, intercept or A, B and C for the form you picked.
  3. Press Calculate slope.
  4. Read the exact slope and the line in all three equation forms.
  5. Use the table of points to check the equation.

Slope from two points: a worked example

Take the points (-1, 4) and (3, -4). The rise is -4 - 4 = -8 and the run is 3 - (-1) = 4. So the slope is -8 / 4 = -2. The line falls 2 units for every 1 unit you move right.

To get the y-intercept, plug either point into y = mx + b. Using (-1, 4): 4 = -2(-1) + b, so b = 2. The line is y = -2x + 2. It crosses the x-axis at (1, 0), and the segment between the two points has its midpoint at (1, 0) as well, with a length of about 8.944.

Formula guide
  • m = (y2 - y1) / (x2 - x1)
Results for the points (-1, 4) and (3, -4)
ResultValue
Rise and run-8 and 4
Slope-2
Slope intercept formy = -2x + 2
Point slope formy - 4 = -2(x + 1)
Standard form2x + y = 2
Interceptsx: (1, 0), y: (0, 2)
Angle of inclinationabout 116.565 degrees
Perpendicular slope1/2

Slope intercept form calculator: y = mx + b

In slope intercept form, m is the slope and b is where the line crosses the y-axis. It's the easiest form to graph: start at (0, b) and move by the slope. Every mode on this page gives you the line in this form, and you can also start from it by choosing Slope-intercept form and entering m and b.

To get there from standard form, solve for y. Ax + By = C becomes y = (-A/B)x + C/B, so the slope is -A/B and the y-intercept is C/B. For 2x + 3y = 12 that's y = (-2/3)x + 4. If B is zero, there's no slope intercept form, because the line is vertical.

Formula guide
  • y = mx + b
  • From Ax + By = C: m = -A/B and b = C/B

Point slope form calculator: y - y1 = m(x - x1)

Point slope form is the natural way to write a line when you know one point and the slope. Plug in the point and slope and you're done, no solving needed. Choose One point and slope to start here, or let the calculator build it from two points.

Say the line passes through (3, -1) with slope 2/3. Point slope form is y + 1 = (2/3)(x - 3). Expand and solve for y and you get y = (2/3)x - 3. Clear the fraction and the standard form is 2x - 3y = 9. Substituting (3, -1) gives 6 + 3 = 9, so the point checks out.

Formula guide
  • y - y1 = m(x - x1)
  • b = y1 - m x x1

Positive, negative, zero and undefined slope

A positive slope rises from left to right and a negative slope falls. A slope of 0 is a flat, horizontal line like y = -5. A vertical line like x = -4 has a run of zero, and you can't divide by zero, so its slope is undefined.

If you enter the same point twice, there's no single line through it, so the calculator asks for two different points instead of reporting 0/0.

How rise and run set the type of line
RiseRunSlopeLine
PositivePositivePositiveRises left to right
NegativePositiveNegativeFalls left to right
0Not zero0Horizontal
Not zero0UndefinedVertical

Angle, percent grade, parallel and perpendicular slopes

Percent grade is the slope times 100. A slope of 0.08 is an 8% grade, but its angle is only about 4.57 degrees, so grade and degrees aren't the same thing. A 100% grade is a slope of 1 and a 45 degree angle. The angle is measured from the positive x-axis, so a negative slope gets an angle between 90 and 180 degrees.

Parallel lines have the same slope. Perpendicular lines have slopes that multiply to -1, so you flip the slope and change its sign: the perpendicular slope to 2/3 is -3/2. With two points, the calculator also gives the perpendicular bisector of the segment.

Slope, angle and grade
SlopeAngle of inclinationPercent grade
00 degrees0%
1/226.565 degrees50%
145 degrees100%
-1135 degrees-100%
Undefined90 degreesUndefined

More worked examples

Each of these starts from a different form. The equations in the third column describe exactly the same line as the starting information.

Slope and line equations from different starting forms
Starting informationSlopeSlope intercept formCheck
(1, 2) and (5, 10)2y = 2xBoth points satisfy 2x - y = 0
Point (3, -1), m = 2/32/3y = (2/3)x - 3Substitution gives -1 = -1
2x + 3y = 12-2/3y = (-2/3)x + 4Intercepts (6, 0) and (0, 4)
(-4, 2) and (-4, 9)UndefinedNone (x = -4)Run is exactly zero
y = -50y = -5No x-intercept

Sources

FAQ

How do you find the slope of a line?

Pick two points on the line and divide the change in y by the change in x. For (1, 2) and (5, 10), that's (10 - 2) / (5 - 1) = 8 / 4 = 2.

How do you convert standard form to slope intercept form?

Solve Ax + By = C for y. You get y = (-A/B)x + C/B. For 2x + 3y = 12, subtract 2x and divide by 3 to get y = (-2/3)x + 4.

How do you write point slope form from two points?

Find the slope from the two points first, then plug it and either point into y - y1 = m(x - x1). Both choices give the same line once you simplify.

Why is the slope of a vertical line undefined?

A vertical line has a run of zero. Slope means dividing the rise by the run, and dividing by zero isn't defined. You write the line as x = a number instead.

What is the slope of a horizontal line?

Zero. The y-value never changes, so the rise is 0 no matter how far you move. A horizontal line is written y = a number, like y = -5.

What is the slope of a perpendicular line?

Flip the slope and change its sign. The perpendicular slope to 2 is -1/2, and to -2/3 it's 3/2. A horizontal line and a vertical line are also perpendicular.

Is a 100% grade a 90 degree angle?

No. A 100% grade means a slope of 1, which is a 45 degree angle. A 90 degree line is vertical and has no percent grade.

Can I enter fractions and decimals?

Yes. Coordinates, slopes and coefficients can be whole numbers, decimals, fractions like -3/4 or scientific notation. The slope and equations stay exact fractions.