Home/Calculator Tools/Slope Calculator
📉

Slope Calculator

FREE

Slope, intercept, line equation and distance from two points

Free · No sign-up required
Loading...

What the slope calculator does

Enter two points, (x₁, y₁) and (x₂, y₂), and the calculator gives the slope of the line through them, the y-intercept, the equation in y = mx + b form, and the straight-line distance between the points. It is the calculation behind gradients on a graph, rates of change in data, and physical slopes — ramps, roofs, drains, roads — where slope is expressed as a ratio, a percentage or an angle. Runs in your browser.

The formulas

Slope m = (y₂ − y₁) / (x₂ − x₁) rise over run Intercept b = y₁ − m·x₁ Equation y = m·x + b Distance d = √( (x₂ − x₁)² + (y₂ − y₁)² ) Points (2, 3) and (6, 11): m = (11 − 3) / (6 − 2) = 8 / 4 = 2 b = 3 − 2 × 2 = −1 y = 2x − 1 d = √(16 + 64) = 8.94

Reading the slope

SlopeMeaning
PositiveLine rises left to right; y increases as x increases
NegativeLine falls left to right
0Horizontal line; y is constant
Undefined (x₁ = x₂)Vertical line; the calculator reports it rather than dividing by zero
|m| > 1Steeper than 45°
|m| < 1Flatter than 45°
Two lines with equal slopesParallel
Slopes whose product is −1Perpendicular

Slope as percentage and angle

Percent grade = m × 100 slope 0.08 = 8% grade Angle = arctan(m) slope 0.08 = 4.6°; slope 1 = 45° Ratio = 1 : (1 / m) slope 0.08 = 1 : 12.5
ApplicationTypical slopeAs grade / angle
Wheelchair ramp (ADA max)1:128.3% / 4.8°
Drainage pipe minimum1:40 to 1:801.25–2.5%
Road, steep hill sign≥ 1:1010% / 5.7°
Driveway comfortable max1:812.5% / 7.1°
Roof, low pitch2:1216.7% / 9.5°
Roof, standard pitch6:1250% / 26.6°
Stairs (typical)7:1164% / 32.5°

Slope as rate of change

On a graph of anything against time, the slope is the rate: distance vs time gives speed, cost vs units gives marginal cost, temperature vs time gives the heating rate. Two readings are enough for an average rate over the interval, which is exactly what this calculator computes. Fitting a slope through many noisy points is linear regression — a spreadsheet's SLOPE() function — and is the natural next step when you have more than two.

Common uses

  • Finding the equation of a line from two points on a graph for homework or a report.
  • Working out the fall on a drain or gutter run from two level readings.
  • Checking a ramp or path meets accessibility limits.
  • Converting a roof pitch between ratio, percent and degrees.
  • Estimating a trend — growth per month from two data points.
  • Getting the distance between two coordinates on a plan.

Frequently asked questions

Does the order of the points matter?

No. Swapping the points flips the signs of both differences, so the slope is unchanged, and distance is always positive.

Why is the slope 'undefined' for my points?

The x values are equal, so the line is vertical and rise ÷ run divides by zero. A vertical line has the equation x = constant.

How do I get the slope from an angle?

m = tan(angle). A 30° slope is tan(30°) = 0.577, or 57.7%.

Can I use it for 3D points?

Not for slope, which is a 2D concept. Distance in 3D adds the z term under the root: √(Δx² + Δy² + Δz²).

How does this relate to the derivative?

The slope between two points is the average rate of change. The derivative is the limit as the points come together — the slope of the tangent line at one point.

Are my values stored?

No. The calculation runs in your browser.

More tools in this category

📊
Percentage Calculator
Quickly calculate percentages and ratios
📈
Percentage Change Calculator
Percentage increase or decrease between two values
🔬
Scientific Calculator
Trig, logs, powers and roots with correct operator precedence
Fraction Calculator
Add, subtract, multiply and divide fractions in lowest terms
📊
Standard Deviation Calculator
Mean, variance and standard deviation — population and sample
🔄
Unit Converter
Length, weight, volume, temperature and speed between metric and imperial