Slope Calculator

Find the slope, see the graph and follow the steps.

Examples:

Drag A or B directly on the graph to change the points.

Slope (m)1
Positive slope
Rise (Δy)4
Run (Δx)4
Angle45°

Interactive coordinate graph

Drag the blue points

The grid shows the line and a rise/run triangle. Drag either blue point to recalculate the slope.

Slope Calculator with Graph, Formula and Step-by-Step Solutions

A slope calculator helps you measure the steepness and direction of a straight line. Give it two coordinates, and it calculates how much the y-value changes compared with the x-value. Instead of stopping at an answer, our calculator draws the line, shows both points, displays a rise-and-run triangle and explains the calculation. This is useful for school coordinate geometry, algebra homework, introductory engineering and practical ramp-gradient questions.

You can use the slope of a line calculator with two points, or enter an equation in the form y = mx + b. The Ramp / Ratio tab is designed for a different but related problem: measuring the grade of an incline from a vertical rise and a horizontal run. Students searching for a ramp slope calculator often need the answer as a percentage, an angle or a 1:N ratio rather than just a decimal.

The calculator works entirely in the browser. You don't need to upload an assignment or install an app. For the coordinate graph, you can even drag the blue points to see how moving a point changes the slope. The diagrams are generated from your values, not static pictures that only illustrate one example.

Quick answer: How to calculate slope

Take two points (x₁, y₁) and (x₂, y₂). Subtract the first y-value from the second, then divide by the difference between the x-values. For points (1, 2) and (5, 6), slope = (6 − 2) ÷ (5 − 1) = 4 ÷ 4 = 1. A rising line has positive slope; a descending line has negative slope.

Slope Formula: Finding Rise Over Run

m = (y₂ − y₁) ÷ (x₂ − x₁) = Rise ÷ Run

The standard slope formula is often called rise over run. The vertical difference between two points is the rise, while the horizontal difference is the run. In algebra, the slope is usually represented by m. The notation Δy means a change in y, and Δx means a change in x. Thus m = Δy/Δx whenever Δx is not zero.

This is the formula for slope, formula for slope of a line and slope formula with two points commonly taught in coordinate geometry. It is also the equation for slope of a line and the equation to find the slope of a line. Although the phrases differ, they refer to the same ratio of vertical change to horizontal change.

Example: Slope between two points

Suppose A = (−2, 3) and B = (4, 9). First calculate the difference in y: 9 − 3 = 6. Next calculate the difference in x: 4 − (−2) = 6. Finally divide: 6 ÷ 6 = 1. The slope is m = 1. These points form a rising straight line at 45 degrees to the positive x-axis.

To answer how to calculate slope of a line, make sure you subtract the points in the same order in both numerator and denominator. If you use y₂ − y₁ above the fraction, you must use x₂ − x₁ below. Reversing both gives the same result, but reversing only one changes the sign incorrectly.

How to Calculate Slope of a Graph

Students asking how to calculate slope of a graph usually have a straight line drawn on coordinate axes. Find two clear points that lie on the line, read their x- and y-coordinates, and use the rise-over-run formula. Choose points where the line crosses grid intersections if possible; this makes the measurements easier and reduces reading errors.

In our interactive graph, A and B represent two points on the same line. A shaded triangle illustrates the change in x and y. The horizontal segment is the run, and the vertical segment is the rise. A larger absolute rise for the same run means a steeper line. If the rise is negative, the line goes down as you travel from left to right.

Unlike a fixed picture, the graph updates when you change the inputs or drag the points. It is a visual calculate slope calculator as well as an online slope calculator. The drawn axes automatically rescale to include the two points, so you can also try negative coordinates and larger values.

Positive, negative, zero and undefined slopes

  • Positive slope: The line rises as x increases, for example m = 2.
  • Negative slope: The line falls as x increases, for example m = −1/2.
  • Zero slope: A horizontal line has no vertical change, so m = 0.
  • Undefined slope: A vertical line has no horizontal change, so division by zero is not defined. Its equation is x = constant.

Consider A = (2, −1) and B = (2, 5). Both points have the same x-coordinate, which makes Δx = 0. The slope is undefined; it is not zero and should not be written as an infinite real-number slope. The calculator displays a vertical-line equation rather than attempting to divide by zero.

Equation of a Line with Two Points

Once the slope is known, you can write the equation of a line with two points. The usual slope-intercept form is y = mx + b, where m is the slope and b is the y-intercept. The y-intercept is the value of y when x = 0. After you calculate m, substitute one known point into the equation to calculate b.

y = mx + b, where b = y₁ − m × x₁

For points (1, 2) and (5, 6), m = 1 and b = 2 − 1 × 1 = 1. Therefore the line equation is y = x + 1. This is one way to find an equation for a line or determine the equation of a line. The result box provides both slope-intercept form and point-slope form when the line is not vertical.

Searches for equation for line, equation for y intercept and formula for y intercept are closely connected. If you know m and one point, calculate b = y − mx. If the given equation is already y = mx + b, the slope is simply the coefficient of x. The Line Equation tab lets you enter those values and see their meaning on a graph.

Point-Slope Equations and Parallel Lines

The point-slope equation of a nonvertical line is y − y₁ = m(x − x₁). It is particularly helpful when a question gives one point and the slope. The slope point formula and point slope equations are alternate terms for the same relationship. For a line through (3, 4) with slope 2, the equation is y − 4 = 2(x − 3). You can expand it to y = 2x − 2 if needed.

The equation of parallel lines is another common algebra topic. Two distinct nonvertical parallel lines have the same slope but different y-intercepts. For example, y = 2x + 1 and y = 2x − 5 are parallel. Two vertical lines are also parallel even though both have undefined slopes.

For a nonhorizontal and nonvertical line with slope m, a perpendicular line has slope −1/m. For instance, a line with slope 2 is perpendicular to a line with slope −1/2. A horizontal line is perpendicular to a vertical line. Use the calculator's equation result to check these relationships when completing coordinate geometry exercises.

Slope Calculator for Ramp: Rise, Run, Grade and Angle

The slope calculator for ramp works with measurements taken along a real incline. Enter the vertical rise and the horizontal run using the same unit. The calculator reports the rise/run ratio, gradient percentage, and angle to the horizontal. Its diagram shows a triangular side view of the ramp so you can see exactly what each measurement means.

Ramp Grade (%) = (Vertical Rise ÷ Horizontal Run) × 100

For a ramp that rises 0.25 m over 3 m of horizontal run, the grade is (0.25/3) × 100 = 8.33%. The slope ratio can be written 1:12, meaning one unit of rise for twelve units of horizontal run. The angle is arctan(0.25/3), approximately 4.76°. All three describe the same straight incline in different formats.

The phrase how to calculate ramp slope refers to this geometry. Don't measure the sloped surface length and treat it as horizontal run: the run is the level distance from start to finish, measured horizontally. For a very steep ramp the difference becomes important. If you have only the sloped length and rise, use the Pythagorean theorem to obtain the horizontal run before using the basic grade formula.

How to calculate slope ratio

To answer how to calculate slope ratio, divide the horizontal run by the rise. Then write the result as 1:N. For example, 0.3 m rise over 3 m horizontal run becomes 1:10; 0.1 m rise over 10 m run becomes 1:100. A ratio of 1:200 means a 1-unit rise for every 200 horizontal units, which equals a 0.5% grade.

A phrase such as 20 1 slope is sometimes written as 20:1 horizontal:vertical instead of 1:20 vertical:horizontal. The direction matters: this page explicitly uses rise:run, so its equivalent is 1:20. Before entering numbers from a drawing or construction document, verify which convention that document uses.

Rise : horizontal runGrade (%)Angle (approx.)Example
1:1010.00%5.71°10 cm over 1 m
1:128.33%4.76°25 cm over 3 m
1:205.00%2.86°5 cm over 1 m
1:1001.00%0.57°1 cm over 1 m
1:2000.50%0.29°1 cm over 2 m

Wheelchair Ramp Slope Calculator

A wheelchair ramp slope calculator can help students understand grade, rise and run in accessibility-design problems. A 1:12 slope, for example, means 12 units of horizontal run per unit of rise. If the rise is 30 cm, the horizontal run at exactly 1:12 would be 360 cm, or 3.6 m. The diagram and steps in the Ramp / Ratio tab make that relationship visible.

However, the calculator does not certify a ramp as accessible or safe. Applicable building and accessibility standards can differ by country, jurisdiction, building type and date, and they can also control landings, handrails, clear width, cross slope and other details. Use the current local rules and professional design advice for real installations. A mathematically correct slope is only one part of a compliant ramp.

Car Ramp, Vehicle Ramp and Road Slope Calculations

Students studying practical geometry may look for a car ramp slope calculator, vehicle ramp slope calculator, road slope calculator or car ramp slope calculator in feet. All use a similar rise/run relationship. If a driveway rises 1 foot over 15 feet horizontally, it has a grade of about 6.67%, an angle of about 3.81°, and a rise:run ratio of 1:15.

A ramp slope calculator in meters and ramp slope calculator in feet produce the same percentage when both rise and run use a consistent measurement unit. For example, 0.5 m rise over 5 m run and 0.5 ft rise over 5 ft run both yield 10%. The physical sizes are different, but the geometry is proportional. You can choose metres, centimetres, millimetres, feet or inches in the ramp tab.

Road and vehicle design includes clearance, traction, turning transitions, drainage and local engineering constraints. The calculator only provides the mathematical incline. It does not determine whether a driveway or parking garage slope is acceptable for a particular car or vehicle.

Roof Slope, Shed Roof and Drain Slope Calculator Examples

A roof slope calculator and shed roof slope calculator often involve roof pitch rather than road grade. In some building traditions, roof pitch is stated as rise per twelve units of horizontal run, such as 4:12. That means a grade of 4/12 × 100 = 33.33%, with an angle of approximately 18.43°. The raw rise/run measurements still work in the calculator, but the label 4:12 should not be confused with the ramp-style ratio 1:3.

A pipe slope calculator or drain slope calculator may measure fall rather than rise. For example, a pipe dropping 2 cm along 2 m horizontal distance has 2/200 × 100 = 1% downward grade. In the Ramp / Ratio mode, enter positive magnitudes to get the grade size; the illustration assumes an upward incline. If you need a signed negative gradient, use the two-point mode with falling y-values.

For a 1:100 slope calculator or 1 100 slope calculator type of question, simply use one unit rise with one hundred units run. A 1:200 grade is half as steep. This is useful for mathematics exercises about gentle slopes and introductory drainage calculations, not a replacement for engineering plans.

Slope of a Tangent Line vs Slope of a Straight Line

The slope of tangent line formula belongs to differential calculus. For a curve y = f(x), the instantaneous slope at x = a is f′(a), provided the derivative exists. For instance, y = x² has derivative f′(x) = 2x, so at x = 3 the tangent slope is 6. A secant line through two points on the same curve instead measures an average rate of change.

This page calculates straight-line slopes and secant slopes between input points. It does not take symbolic derivatives or claim that every two-point calculation is the tangent of a curve. For a curved graph, pick two points if the question asks for average change, or use calculus if it asks for the instantaneous tangent slope.

Slope Calculator Examples for Homework

Two pointsRiseRunSlopeLine type
(1,2), (5,6)441Positive
(0,5), (4,1)−44−1Negative
(−2,3), (4,3)060Horizontal
(2,−1), (2,5)60UndefinedVertical
(−1,−4), (3,2)641.5Positive

You can enter each example in the two-point calculator and watch the graph change. This helps connect the numerical answer to the appearance of the line. For a slope of 1.5, the line rises 1.5 units for each unit to the right; for a slope of −1, it falls one unit for each unit to the right.

Common Mistakes When Finding Slope

  • Mixing subtraction order: y₂ − y₁ must be paired with x₂ − x₁, not the reverse.
  • Confusing horizontal and vertical change: Rise is Δy, run is Δx; swapping them gives a reciprocal.
  • Calling a vertical slope zero: Vertical slope is undefined because the run is zero.
  • Using a sloped ramp length for the run: Ramp grade uses the horizontal projection, not the surface length.
  • Mixing metres with feet: Convert both physical measurements to one unit before dividing.
  • Confusing percentage and angle: A 10% grade is arctan(0.1) ≈ 5.71°, not 10°.
  • Reversing ratio conventions: This tool labels the ratio as rise:run; some documents write run:rise.
  • Assuming tangent and secant slopes are identical: A line through two points on a curve gives average, not automatically instantaneous, change.

Frequently Asked Questions About Slope Calculator

1. How to calculate slope between two points?

Subtract the y-coordinates and divide by the difference between the x-coordinates: m = (y₂ − y₁)/(x₂ − x₁). The tool also draws both points and the connecting line.

2. What is the slope formula?

The slope formula is rise divided by run, or Δy/Δx. The denominator must not be zero.

3. How to calculate slope of a graph?

Pick two points on the line, read their coordinates, and divide vertical change by horizontal change. Our graph visualizes this as a triangle.

4. What does a negative slope mean?

It means the line goes downward as you move from left to right on the coordinate plane.

5. What is the slope of a vertical line?

Undefined, because the x-values are equal and the slope calculation would divide by zero.

6. How do I find y-intercept from slope and a point?

Use the formula for y intercept, b = y − mx. The calculator shows the value when a line is not vertical.

7. What is point-slope form?

It is y − y₁ = m(x − x₁), a way to write a nonvertical line using one point and its slope.

8. What is the slope of parallel lines?

Parallel nonvertical lines have the same slope. Two vertical lines are also parallel even though their slopes are undefined.

9. How do I find ramp grade percentage?

Divide vertical rise by horizontal run, then multiply by 100. For 0.2 m over 2 m, the grade is 10%.

10. What does 1:12 ramp slope mean?

It means one unit of vertical rise for every twelve units of horizontal run: approximately 8.33% grade.

11. How do I convert grade percentage to an angle?

Calculate arctan(grade ÷ 100), then convert the result from radians to degrees. A 10% grade is approximately 5.71°.

12. Can I calculate slope in feet or metres?

Yes. Select the length unit in the ramp tab. Both measurements must use the same unit for the ratio to make sense.

13. Is this a wheelchair ramp compliance checker?

No. It calculates geometry only; accessibility requirements also include other specifications and depend on local rules.

14. Can I drag the points on mobile?

Yes. The coordinate plot supports touch and mouse dragging, and the fields update when points move.

15. Is this a linear fit calculator?

No. A linear fit online tool estimates a best-fit line from a larger collection of noisy data. This page draws the exact line through two specified points, not a least-squares regression.

Use the Slope Calculator Online

Enter two points to calculate rise, run, angle, slope-intercept equation and a visible line. Or select Line Equation to draw y = mx + b directly. For ramps, driveways and classroom grade problems, select Ramp / Ratio to find the gradient percentage, angle and 1:N rise/run relationship. This slope calculator is meant to make the mathematics visible and the results understandable, with no login and no extra software.