ToolsVortex
Explore tools
Slope Calculator on ToolsVortex with a worked example filled in

Slope Calculator

ToolsVortex · Math & School

Enter two points to get the slope of the line through them, its equation in y = mx + b form, the y-intercept, the angle, the distance between the points and the midpoint. Vertical lines are handled too.

Slope
m = 2
Rising line through (2, 3) and (6, 11)
y = 2x − 1Equation
(0, −1)Y-intercept
63.4349°Angle
8.9443Distance
(4, 7)Midpoint
200%Grade (percent)

Runs in your browser. Nothing you type is sent anywhere.

Slope Calculator on ToolsVortex with a worked example filled in
Slope Calculator: points (2, 3) and (6, 11) give m = 2 and y = 2x − 1.

This slope calculator is for algebra and geometry students, teachers, and anyone working out a ramp, roof or road gradient. Type the coordinates of two points and you get the slope as a decimal and as a fraction, the full line equation, and the working, so you can check each step of your homework.

How Do You Find the Slope Between Two Points?

To find the slope between two points, divide the change in y by the change in x: m = (y2 − y1) / (x2 − x1). For the points (2, 3) and (6, 11), m = (11 − 3) / (6 − 2) = 8 / 4 = 2. The line rises 2 units for each unit to the right.

What Does Slope Mean?

Slope measures how steep a line is: it is the rise over run, the vertical change divided by the horizontal change between any two points on the line. It is usually written as the letter m.

m = (y2 − y1) / (x2 − x1) = rise / run

A positive slope rises from left to right, a negative slope falls, a slope of 0 is a flat horizontal line, and a vertical line has an undefined slope because its run is 0 and you cannot divide by 0. The tool shows “Undefined” and the equation x = c for vertical lines, such as x = 3 for the points (3, 1) and (3, 9).

How Do You Write the Equation of a Line in Slope Intercept Form?

You write it as y = mx + b, where m is the slope and b is the y-intercept, the y value where the line crosses the y-axis. This is called slope-intercept form. Once you know m, find b from either point with b = y1 − m × x1. For (2, 3) and (6, 11), b = 3 − 2 × 2 = −1, so the line is y = 2x − 1. When the slope is a repeating decimal, the tool also gives the exact fraction form, so (−1, 4) and (5, 0) give y = −(2/3)x + 10/3. The fraction calculator helps if you want to simplify such answers by hand.

How Do You Convert Slope to an Angle?

To convert slope to an angle, take the inverse tangent: angle = arctan(m). This is the angle of inclination, measured from the positive x-axis. A slope of 1 is 45°, a slope of 2 is about 63.43°, and a slope of 1/12 is about 4.76°. Slope can also be written as a grade in percent by multiplying m by 100, which is how road signs show steepness, so a slope of 0.08 is an 8% grade. The percentage calculator is handy for working with grades.

Slope mAngleGradeRatio
00°0%flat
0.08334.7636°8.3333%1:12
0.2514.0362°25%1:4
0.526.5651°50%1:2
145°100%1:1
263.4349°200%2:1
371.5651°300%3:1
undefined90°nonevertical

How Do You Find the Distance Between Two Points?

You find the distance with the distance formula, d = √((x2 − x1)² + (y2 − y1)²), which comes straight from the Pythagorean theorem. The run and the rise are the two short sides of a right triangle, and the distance is the long side. For (2, 3) and (6, 11) that is √(4² + 8²) = √80 ≈ 8.9443. You can check the same triangle with the Pythagorean theorem calculator. The midpoint is the average of the coordinates, here (4, 7).

Worked Example

A builder plans a wheelchair ramp that rises 1 foot over a 12 foot run. Enter the points (0, 0) and (12, 1). The tool gives a slope of m = 0.0833 (1/12), the equation y = (1/12)x, an angle of 4.7636° and a grade of 8.3333%. The ramp surface is 12.0416 feet long. A ratio of 1:12 is the maximum running slope for ramps under the 2010 ADA Standards in the United States, so this ramp is right at the limit. Local building codes can differ, so check the rules where you build.

How Do You Use the Slope Calculator?

  1. Enter point 1

    Type the x1 and y1 coordinates of the first point, such as 2 and 3.

  2. Enter point 2

    Type the x2 and y2 coordinates of the second point, such as 6 and 11.

  3. Read the slope

    The big result shows m as a decimal, with the exact fraction when it is not a whole number.

  4. Use the line details

    The boxes show y = mx + b, the y-intercept, angle, distance, midpoint and grade.

How to use the Slope Calculator, steps 1 to 4 numbered on the tool
The numbers on the picture match the steps above.

Frequently Asked Questions

What is the slope of a horizontal line?

A horizontal line has a slope of 0, because the rise is 0. For the points (0, 2) and (5, 2), m = (2 − 2) / (5 − 0) = 0 / 5 = 0, and the equation is simply y = 2.

Why is the slope of a vertical line undefined?

A vertical line has a run of 0, since both points share the same x value. The slope formula then divides by 0, which has no answer. For (3, 1) and (3, 9) the line is x = 3 and its angle is 90°.

Does it matter which point I call point 1?

No. Swapping the points flips the sign of both the rise and the run, so the slope stays the same. (11 − 3) / (6 − 2) and (3 − 11) / (2 − 6) both equal 2.

What does a negative slope look like?

A negative slope means the line falls as you move right. The points (−1, 4) and (5, 0) give m = −4 / 6 = −2/3, about −0.6667, so y drops 2 units for every 3 units to the right.

How do I turn a slope into a percent grade?

Multiply the slope by 100. A slope of 0.06 is a 6% grade, meaning a 6 foot rise over 100 feet. A slope of 1 is a 100% grade, which is a 45° angle, not a vertical wall.

What is the y-intercept if the line is vertical?

A vertical line such as x = 3 never crosses the y-axis, so it has no y-intercept. The one exception is x = 0, which is the y-axis itself, so every point on it lies on the y-axis.

Sources and Further Reading

Related Tools

Last reviewed: October 2026