Skip to main content
Calculator Tools
MathFreeNo sign-up

Slope Calculator - Free Online Calculator

Calculate the slope (gradient) of a line through two points, plus its y-intercept, equation in slope-intercept form and angle with the x-axis. Used in algebra, calculus, surveying and engineering.

  • Formula shown on the page
  • Runs in your browser
  • Your inputs stay private

Point 1 (x₁, y₁)

Point 2 (x₂, y₂)

Slope (m)

2

Δy / Δx = 12 / 6

Δx (run)

6

Δy (rise)

12

Angle with x-axis

63.434949°

Y-intercept (b)

-1

y = mx + b

Line equation

y = 2.0000x − 1.0000

About

Understanding the Slope Calculator

Slope (or gradient) is one of the most useful single concepts in mathematics - it measures how steeply something rises or falls. In coordinate geometry it's the slope of a line through two points; in calculus it generalises to the derivative of a curve at a point; in real life it appears as road grade percentage (highway signs say '8% gradient ahead'), roof pitch ratios for monsoon drainage, staircase rise/run for code-compliant design, ramp inclines for wheelchair accessibility (max 1:12 per accessibility standards), and stock chart trend lines.

Class 9-10 mathematics introduces slope through coordinate geometry; Class 11-12 builds it through trigonometric angles and derivatives; JEE/NEET physics uses it for motion graphs (slope of position-time graph = velocity, slope of velocity-time graph = acceleration). This calculator computes slope from two points along with the line's y-intercept, complete equation in slope-intercept form (y = mx + c), angle with the positive x-axis, and special-case handling for vertical and horizontal lines.

How to use

Using the Slope Calculator in 3 steps

  1. Enter the coordinates of point 1.

  2. Enter the coordinates of point 2.

  3. Read slope, intercept, equation and angle.

The formula

How the Slope Calculator works

Slope is rise over run - vertical change divided by horizontal change. Once you have slope m and any point, the y-intercept comes from y = mx + b ⇒ b = y − mx. The angle with the x-axis is arctan(m).

Formula

m = (y₂ − y₁) / (x₂ − x₁) y = m·x + b θ = arctan(m)

  • mSlope (gradient)
  • bY-intercept
  • θAngle with positive x-axis
The maths

How the Slope Calculator gets its answer

Slope formula: m = (y₂ − y₁) / (x₂ − x₁), often expressed as 'rise over run.' The order of points doesn't matter as long as you're consistent - switching both numerator and denominator order yields the same result. Vertical lines (x₂ = x₁) have undefined slope; horizontal lines (y₂ = y₁) have slope 0.

From slope to line equation: once you have slope m and any point (x₁, y₁), the y-intercept b = y₁ − m × x₁. So the full line equation in slope-intercept form is y = mx + b. Alternative point-slope form: y − y₁ = m(x − x₁). Both describe the same line; pick whichever is more convenient.

Angle with x-axis: θ = arctan(m), measured anticlockwise from positive x-axis. Slope 1 corresponds to 45°; slope √3 to 60°; slope 0 to 0° (horizontal); slope -1 to 135° (or -45°). Practical interpretations: gradient as percentage = m × 100% (so slope 0.08 = 8% gradient, common road sign value); ratio form like 1:12 means slope 1/12 ≈ 0.083 or about 4.76°.

Examples

Worked examples

Line through (2, 3) and (5, 11)

m = (11 - 3) / (5 - 2) = 8/3 ≈ 2.67. b = 3 - (8/3) × 2 = 3 - 16/3 = -7/3 ≈ -2.33. Equation: y = (8/3)x - 7/3. Angle: arctan(8/3) ≈ 69.4°. Steeply rising line.

Roof pitch: 4:12 (4 inch rise per 12 inch run)

Slope = 4/12 = 0.333. Angle = arctan(0.333) ≈ 18.4°. Common Indian residential roof pitch for monsoon water drainage. Steep enough to shed water; gentle enough for easy construction.

Wheelchair ramp accessibility: 1:12 standard

Slope = 1/12 = 0.0833. Angle = arctan(0.0833) ≈ 4.76°. Maximum allowed slope for accessible ramps under most building codes including Indian Harmonised Guidelines.

Use cases

When to use the Slope Calculator

  • Class 9-12 coordinate geometry - slope of a line through two points.
  • JEE Main / Advanced - coordinate geometry, motion graph problems.
  • Physics - velocity from position-time graph, acceleration from velocity-time graph.
  • Civil engineering - road grade, drainage slope, roof pitch.
  • Accessibility design - wheelchair ramps must be ≤ 1:12 slope.
  • Surveying and topographic analysis - terrain steepness.
  • Statistics - regression line slope (least squares).
  • Stock and chart analysis - trendline slope as momentum indicator.
Watch out

Common mistakes and gotchas

  • Forgetting that vertical lines have undefined (not infinite) slope.
  • Mixing up the order of subtraction - must use (y₂ - y₁) / (x₂ - x₁), not (x₂ - x₁) / (y₂ - y₁) which gives the reciprocal.
  • Confusing slope with angle. Slope is dimensionless ratio; angle is degrees or radians.
  • Reading roof pitch backwards - 12:4 vs 4:12. Indian convention is rise:run = 4:12 for ~18° pitch.
  • Forgetting that parallel lines have the same slope; perpendicular lines have slopes that are negative reciprocals of each other (m₁ × m₂ = -1).
Pro tips

Get more out of this tool

  • Convert slope to percentage: m × 100% (useful for road grade signs and ramp specifications).
  • Convert slope to angle: arctan(m) in degrees (most practical for construction).
  • Parallel lines have equal slopes; perpendicular lines have slopes multiplying to -1.
  • Slope of horizontal line is 0; slope of vertical line is undefined.
  • Pair with the distance, area and trigonometry calculators on this site for related coordinate geometry work.
FAQ

Questions about the Slope Calculator

What if x₁ = x₂?

The line is vertical - slope is undefined (infinite). The line equation becomes x = constant.

Slope of a horizontal line?

Zero. y₂ = y₁, so the numerator is 0 and m = 0. The line is y = b.

Positive vs negative slope?

Positive: line rises left-to-right. Negative: falls. Magnitude tells you steepness - slope of 2 is twice as steep as slope of 1.

How is slope used in real life?

Road grade (% slope), roof pitch, wheelchair ramp gradients (max 1:12 by ADA), staircase rise/run ratios.

Slope-intercept vs point-slope form?

Slope-intercept: y = mx + b. Point-slope: y − y₁ = m(x − x₁). Same line, different form. Calculator gives slope-intercept; converting is one rearrangement.

What's slope's connection to derivatives?

The slope between two points becomes the derivative as those points become infinitesimally close. Calculus generalises slope to curves.

Math in your browser

From simple percentages to scientific notation, statistics, geometry and big-number arithmetic - every common math problem you'd reach for a calculator for, runs in your browser with no installs. The fraction calculator preserves exact rationals, the big-number calculator uses BigInt for hundreds of digits without precision loss, and the scientific calculator's expression evaluator is a hand-written shunting-yard parser (no eval) that supports trig, log, factorial and parentheses.

If you're a student, double-check your work without paying for a graphing calculator. If you're a professional, use these tools as a sanity check on spreadsheet formulas. Every result is shown alongside its formula and inputs, so the math is always auditable.

The Slope Calculator is part of the Math suite on Online Calculator Tools, alongside 6 related calculators. All tools share the same UI patterns, the same privacy-first rendering (nothing is sent to a server), and the same commitment to showing the formula and assumptions behind every result.