Advertisement

📈 Slope Calculator

Find slope, angle, distance, and midpoint between two points on the coordinate plane.

Line Slope From Two Points — Rise Over Run

BrainyCalculators editorial insight — unique to this tool

Slope m = (y₂−y₁)/(x₂−x₁) — wheelchair ramp ADA max ~1:12 (8.33% grade). Roof pitch 6:12 means 6 inch rise per foot run. Parallel lines share slope; perpendicular slopes multiply to −1.

When to use this calculator

Use for line steepness and equation from points. For best-fit line through many points, use Regression.

Fitting a line to many data points?

This page uses two points only. For least-squares regression on a dataset, use the Regression Calculator →

Point 1 (x₁, y₁)

Point 2 (x₂, y₂)

What is a Slope Calculator?

A slope calculator computes rise over run between two (x, y) points, the line angle, and related distance and midpoint values. It answers geometry-of-a-line questions for exactly two points.

Use this page for homework-style “find the slope through (x₁,y₁) and (x₂,y₂).” For many data pairs and a best-fit line, use Linear Regression instead.

Correlation measures strength of association across a full dataset; slope here is between two specified points only.

Slope Formulas

Slope: m = (y₂ − y₁) / (x₂ − x₁)
Y-intercept: b = y₁ − m × x₁
Line equation: y = mx + b
Angle: θ = arctan(m) [in degrees]
Distance: d = √((x₂−x₁)² + (y₂−y₁)²)
Midpoint: M = ((x₁+x₂)/2, (y₁+y₂)/2)

Worked Example — Points (1, 2) and (4, 8)

m = (8 − 2) / (4 − 1) = 6 / 3 = 2
b = 2 − 2 × 1 = 0
Equation: y = 2x
Angle: arctan(2) ≈ 63.43°
Distance: √((4−1)² + (8−2)²) = √(9+36) = √45 ≈ 6.708
Midpoint: ((1+4)/2, (2+8)/2) = (2.5, 5)

How the Slope Calculator Works

Formula, assumptions, and calculation steps for this math tool.

Methodology

Math calculators apply the relevant arithmetic, algebraic, geometric, or numeric rule to the values entered and simplify the result where possible.

Calculation Steps

  1. Read the values and operation selected.
  2. Normalize signs, decimals, fractions, or units if needed.
  3. Apply the mathematical rule or formula.
  4. Format the answer and any intermediate values for checking.

Assumptions and Limits

  • Inputs must be within the supported domain of the operation.
  • Decimal answers may be rounded for readability.
  • Symbolic simplification is limited to the calculator scope.

Frequently Asked Questions

Slope (m) measures how steep a line is — the ratio of vertical change (rise) to horizontal change (run) between any two points on the line. A larger absolute value means a steeper line.

Use the formula m = (y₂ − y₁) / (x₂ − x₁). Subtract the y-coordinates and divide by the difference in x-coordinates. For example, points (2, 3) and (6, 11): m = (11−3)/(6−2) = 8/4 = 2.

The y-intercept (b) is the point where the line crosses the y-axis (where x = 0). Once you have the slope, calculate it as b = y₁ − m × x₁ using either of the two given points.

Slope-intercept form is y = mx + b, where m is the slope and b is the y-intercept. It makes it easy to graph a line — start at (0, b) on the y-axis, then move right 1 unit and up m units.

Real-World Applications

🏗️
Road & Highway Grade Design
Civil engineers specify road gradient as a percentage slope — maximum grades for US highways are typically 6–8% in flat terrain (rising 6–8 metres per 100 metres of horizontal run). Steeper grades are problematic for heavy vehicles and braking distance. The slope calculator converts between rise/run ratios, percentage grades, and degree angles used in different engineering standards.
ADA Accessibility Ramp Design
The Americans with Disabilities Act (ADA) mandates a maximum ramp slope of 1:12 (8.33%) for wheelchair accessibility — 1 inch of rise per 12 inches of run. A slope calculator verifies whether a proposed ramp with a given rise and run meets this standard, and calculates the minimum required ramp length for a specific doorway step height.
📊
Linear Regression Coefficient Interpretation
In statistics, the slope of a regression line (β₁ in y = β₀ + β₁x) represents the average change in the dependent variable for each unit increase in the independent variable. A regression of salary on years of experience with slope = 3,500 means each additional year is associated with $3,500 higher salary on average. The slope calculator reinforces this interpretation by making the rise-over-run concept concrete.
🌊
Drainage & Plumbing Gradient Calculation
Drainage pipes and gutters must maintain a minimum fall (slope) to ensure water flows freely without pooling — building codes typically require a minimum 1:40 gradient (2.5%) for residential drains. A slope calculator determines whether a proposed drain run has sufficient fall given the outlet and inlet heights and the horizontal distance between them.
🎿
Ski & Mountain Slope Rating
Ski resort trail ratings (green/blue/black) correspond approximately to slope angles: green runs are typically 6–25%; blue runs 25–40%; black diamonds 40%+. Slope calculators are used by ski trail designers and mountain safety teams to measure and document piste gradients, and by skiers assessing the difficulty of a given run from a trail map's elevation profile.
🔋
Solar Panel Tilt Optimisation
Solar panel installers calculate the optimal mounting angle (slope) based on latitude to maximise annual energy generation — panels tilted at the local latitude angle approximately maximise annual yield. The slope calculator converts between tilt angle in degrees and the rise/run ratio used when designing the mounting frame, ensuring panels are positioned at the target angle within acceptable tolerance.

Common Mistakes

1
Confusing slope as a ratio with slope as a percentage or angle
A slope of 0.1 (rise/run ratio), a 10% grade (× 100), and a 5.71° angle all describe the same incline — but they are expressed in different units. Using a slope ratio where a percentage grade is expected (or vice versa) produces a factor-of-100 error. Civil engineers typically use percentage grade; mathematicians use the dimensionless ratio; surveyors may use degrees. Always confirm which format the application requires before calculating.
2
Calculating slope with x₁ and x₂ coordinates reversed
Slope = (y₂ − y₁) / (x₂ − x₁) — the sign depends critically on which point is labelled (x₁, y₁) and which is (x₂, y₂). Reversing the labelling reverses the sign of both numerator and denominator, but since both reverse simultaneously, the final ratio is the same. However, if only the y-coordinates are reversed while x-coordinates stay the same (a common transcription error), the sign of the slope flips — turning an upward slope into a downward one.
3
Confusing undefined slope (vertical line) with zero slope (horizontal line)
A horizontal line has a slope of 0 (no vertical change per unit horizontal change). A vertical line has an undefined slope (zero horizontal change causes division by zero). These are opposite extremes and are commonly confused — a vertical line is often incorrectly described as having "infinite slope" or "zero slope." Mathematically, the slope of a vertical line is undefined, not infinite.
4
Using the wrong formula for the equation of a line through two points
Given two points, the line equation is found by: (1) calculate slope m = (y₂−y₁)/(x₂−x₁), then (2) substitute one point into y − y₁ = m(x − x₁) to solve for b in y = mx + b. A common error is substituting both x and y values from one point without solving for b, or using the slope-intercept form y = mx + b without correctly isolating b. The slope calculator performs this derivation automatically, but verifying with a second point confirms correctness.
5
Interpreting slope without considering the scale of the axes
A slope of 1 looks 45° on a graph only when x and y axes have equal scale. On a graph where the y-axis spans 0–1,000 and the x-axis spans 0–10, a slope of 100 looks 45° even though it represents a steep practical gradient. When interpreting a slope's visual steepness from a graph, always check the axis scales before drawing conclusions — numerical slope values are scale-independent, but visual appearance is not.

Slope Format Conversion Quick Reference

Rise:Run Ratio % Grade Angle (°) Context
1:40 2.5% 1.43° Minimum drain fall
1:12 8.33% 4.76° ADA max ramp slope
1:10 10% 5.71° Steep residential driveway
1:4 25% 14.04° Steep footpath / ski blue run
1:1 100% 45° Maximum practical grade

References

  1. Stewart, J. Calculus: Early Transcendentals. Cengage, 2016.
  2. US Access Board. ADA Standards for Accessible Design. access-board.gov, 2010.
  3. AASHTO. A Policy on Geometric Design of Highways and Streets (Green Book). AASHTO, 2018.
  4. Montgomery, D.C. and Runger, G.C. Applied Statistics and Probability for Engineers. Wiley, 2018.
  5. ICC. International Plumbing Code — Chapter 7: Sanitary Drainage. ICC, 2021.