Slope Calculator

Find slope (rise over run), distance, and line equation from two points. Outputs slope-intercept, point-slope, and standard form with a visual plot.

The slope between two points (x₁, y₁) and (x₂, y₂) is (y₂ - y₁) divided by (x₂ - x₁) - the rise over the run. Enter any two coordinates and this calculator returns the slope, y-intercept, distance, midpoint, and the line equation in slope-intercept, point-slope, and standard form, along with a visual plot marking both points and the rise/run triangle.

Ad
Ad

About Slope Calculator

How the Slope Formula Works

Slope is the change in y divided by the change in x, written as m = (y₂ - y₁) / (x₂ - x₁). A positive value means the line climbs from left to right, a negative value means it falls, zero means it is horizontal, and a vertical line has undefined slope because the denominator is zero.

Worked example. For points (2, 3) and (6, 11):

  • Rise (change in y): 11 - 3 = 8
  • Run (change in x): 6 - 2 = 4
  • Slope: m = 8 / 4 = 2
  • Interpretation: the line rises 2 units for every 1 unit moved to the right

Order matters only in the sense that you must subtract in the same direction on top and bottom. (y₁ - y₂) / (x₁ - x₂) gives the same answer: (3 - 11) / (2 - 6) = -8 / -4 = 2. Mixing the order (y₂ - y₁) / (x₁ - x₂) flips the sign and is the most common mistake students make.

What Does the Slope Value Mean?

A slope of m tells you how many vertical units the line moves for each horizontal unit. |m| > 1 is steep, |m| < 1 is shallow, and |m| = 1 is a 45° angle.

SlopeDirectionExample
Positive (m > 0)Line goes up from left to rightm = 3: steep upward
Zero (m = 0)Horizontal liney = 5: flat
Negative (m < 0)Line goes down from left to rightm = -2: downward
UndefinedVertical line (division by zero)x = 3: straight up
m = 145° angle upwardRises equally to run
m = -145° angle downwardFalls equally to run

Three Forms of a Line Equation

Once you know the slope and one point, you can write the line in three equivalent forms. Each one is useful for a different purpose.

FormFormulaExample (m=2, passes through (2,3))Best For
Slope-intercepty = mx + by = 2x - 1Graphing, reading slope and y-intercept directly
Point-slopey - y₁ = m(x - x₁)y - 3 = 2(x - 2)Writing equations quickly from a point and slope
StandardAx + By = C2x - y = 1Systems of equations, integer coefficients

Finding the y-intercept. From slope-intercept form, b = y₁ - m·x₁ = 3 - 2(2) = -1. The line crosses the y-axis at (0, -1). Every line that is not vertical crosses the y-axis exactly once.

Converting between forms. Starting from point-slope y - 3 = 2(x - 2), distribute the 2: y - 3 = 2x - 4, then add 3 to both sides to get y = 2x - 1 (slope-intercept). Rearranged as 2x - y = 1, that is standard form with A = 2, B = -1, C = 1. Most teachers prefer standard form with A positive and A, B, C as integers with no common factor.

Distance Between Two Points

The distance between two points is the straight-line length of the segment joining them, calculated with the Pythagorean theorem applied to the rise and run: d = √((x₂ - x₁)² + (y₂ - y₁)²).

Worked example. For (2, 3) and (6, 11): d = √((6-2)² + (11-3)²) = √(16 + 64) = √80 ≈ 8.944 units. The rise, run, and distance form a right triangle where the distance is the hypotenuse, the run is the horizontal leg, and the rise is the vertical leg.

Midpoint Between Two Points

The midpoint is found by averaging the x-coordinates and the y-coordinates separately: M = ((x₁ + x₂)/2, (y₁ + y₂)/2). It is the single point that is equidistant from both endpoints and lies exactly on the line between them.

Worked example. Midpoint of (2, 3) and (6, 11) is ((2+6)/2, (3+11)/2) = (4, 7). Quick check: distance from (2, 3) to (4, 7) is √(4 + 16) ≈ 4.47, and from (4, 7) to (6, 11) is also √(4 + 16) ≈ 4.47.

Slope in the Real World

Slope shows up anywhere something rises or falls over a horizontal distance. Here are the reference values engineers, builders, and athletes actually use.

ContextSlope MeaningTypical Values
Interstate highway (AASHTO/FHWA)Max grade by terrain4% level, 5% rolling, 6% mountainous (+1% urban)
Roof pitchRise per 12 inches of run4/12 (low slope), 6/12 (standard), 12/12 (45°)
Wheelchair ramp (ADA 2010)Max running slope1:12 = 8.33% grade = m ≈ 0.083
Staircase (IRC)Rise per tread7¾" max rise / 10" min tread = m ≈ 0.775
Ski slope rating (typical US)Average vertical dropGreen: < 25%, Blue: 25-40%, Black: 40%+
Railway (standard)Max grade for freight1-2.2% typical, rarely above 4%

The US Access Board's ADA standard limits the running slope of wheelchair ramps to 1:12 (one inch of rise per twelve inches of run) with an absolute maximum rise of 30 inches before a landing is required. Slopes up to 1:8 are allowed only on very short ramps in existing buildings where space is tight. The Federal Highway Administration's interstate standards cap grade at 4% on level terrain, 5% on rolling, and 6% in mountains, with one extra percent permitted in urban areas.

Parallel and Perpendicular Lines

Two lines are parallel when their slopes are equal (m₁ = m₂) and perpendicular when their slopes multiply to -1 (m₁ · m₂ = -1), meaning one slope is the negative reciprocal of the other. A line with slope 3 is parallel to any other line with slope 3, and perpendicular to any line with slope -1/3.

Worked example. Given the line y = 2x + 4, a parallel line through (0, 7) is y = 2x + 7. A perpendicular line through the same point has slope -1/2, giving y = -0.5x + 7. The special cases: a horizontal line (m = 0) is perpendicular to a vertical line (undefined slope), even though the product rule does not apply literally.

Converting Slope to Angle and Percent Grade

Slope is a ratio, percent grade is that ratio multiplied by 100, and angle is the arctangent of the slope. The three are interchangeable and each is useful in a different field: road signs use percent grade, construction drawings use rise-over-run ratios, and trigonometry uses angles.

The conversion formulas are: percent grade = m × 100, and angle θ = arctan(m) in degrees. To reverse, m = tan(θ). Here are the values people look up most often.

Slope (m)Percent GradeAngleRatioExample
0.022%1.15°1:50Minimum drainage slope
0.0838.33%4.76°1:12ADA wheelchair ramp max
0.110%5.71°1:10Short ramp exception (ADA)
0.2525%14.04°1:4Steep driveway
0.57757.7%30°-Common staircase
1.0100%45°1:1Very steep roof (12/12 pitch)
1.732173.2%60°-Extreme - rarely built

A common confusion: a "100% grade" is not vertical. It is a 45° slope, where rise equals run. True vertical is an infinite percent grade (division by zero) or a 90° angle.

Common Mistakes to Avoid

  • Flipping rise and run. Slope is always (change in y) / (change in x). Writing Δx / Δy inverts the answer.
  • Sign errors. Subtract in the same direction top and bottom. (y₂ - y₁) / (x₂ - x₁), not (y₂ - y₁) / (x₁ - x₂).
  • Treating undefined as zero. A vertical line has no defined slope. A horizontal line has slope 0. They are opposites, not the same.
  • Confusing slope with angle. Slope is a ratio, not an angle. To convert, use θ = arctan(m). Slope 1 is 45°, slope 0.577 is 30°, slope 1.732 is 60°.
  • Dropping units when comparing. A 6% road grade and a slope of 0.06 are the same thing. A 1:12 ramp and a slope of 0.083 are the same thing. Keep the conversion in mind when reading specs.

For plotting these lines alongside curves, parabolas, and other functions, the graphing calculator handles a full coordinate system. To solve linear equations or systems step by step, use the equation solver. For squaring and square-rooting the rise and run by hand, the quadratic calculator is handy.

Where Slope Is Used in Higher Maths

Slope is the starting point for calculus. The derivative of a function at a point is the slope of the tangent line there - the instantaneous rate of change. For the straight line y = 2x - 1, the derivative is 2 everywhere, matching the constant slope. For a curve like y = x², the slope at x = 3 is the derivative 2x evaluated at 3, which is 6.

In statistics, the slope of a regression line through a scatter plot is calculated the same way as the slope between two points, but averaged across every data point using the least-squares formula: m = Σ((x - x̄)(y - ȳ)) / Σ((x - x̄)²). In physics, slope on a position-time graph is velocity, and slope on a velocity-time graph is acceleration.

All calculations run in your browser. Nothing is sent to a server.

Sources

Frequently Asked Questions

How is slope calculated?

Slope is rise over run, calculated as (y2 - y1) divided by (x2 - x1). It tells you how steep a line is and in which direction it goes. A positive slope goes up from left to right, a negative slope goes down.

What does undefined slope mean?

Undefined slope occurs when the two points share the same x-coordinate, creating a vertical line. You'd be dividing by zero since x2 - x1 equals 0. Vertical lines are written as x = some constant.

What are the different equation forms?

Slope-intercept form is y = mx + b where m is slope and b is the y-intercept. Point-slope form is y - y1 = m(x - x1). Standard form is Ax + By = C where A, B, and C are integers and A is positive.

How is the distance between two points calculated?

Distance uses the formula: square root of ((x2 - x1) squared + (y2 - y1) squared). This comes from the Pythagorean theorem applied to the horizontal and vertical distances between the points.

What is the midpoint?

The midpoint is the exact middle between two points. It is calculated by averaging the x-coordinates and averaging the y-coordinates: ((x1 + x2) / 2, (y1 + y2) / 2).

Link to this tool

Copy this HTML to link to this tool from your website or blog.

<a href="https://toolboxkit.io/tools/slope-calculator/" title="Slope Calculator - Free Online Tool">Try Slope Calculator on ToolboxKit.io</a>