Slope Calculator
Calculate slope (gradient) between two points. Find slope, intercept, distance, and line equation for any two coordinate pairs.
About the Slope Calculator
A slope calculator finds the slope (gradient) of a line from two points, calculates the equation of the line in slope-intercept form (y = mx + b) and point-slope form, determines parallel and perpendicular line slopes, and computes the angle the line makes with the horizontal. Slope is one of the most fundamental concepts in algebra, calculus, and applied science — it measures the rate of change of one quantity relative to another. In algebra, slope describes the steepness and direction of a straight line. In calculus, the derivative is the slope of a tangent line (instantaneous rate of change). In engineering, road gradient and roof pitch are expressed as slopes. In physics, the slope of a velocity-time graph is acceleration. In economics, marginal cost and marginal revenue are slopes of cost and revenue curves. Our calculator works with coordinate pairs, angle inputs, and percentage grades, covering all contexts in which slope appears.
Formula
m = (y2-y1)/(x2-x1) = rise/run | y = mx + b (slope-intercept) | Perpendicular slope = -1/m | Angle = arctan(m)
How It Works
Slope formula: m = (y2 - y1) / (x2 - x1) = rise / run. Example: points (2, 3) and (8, 9). m = (9-3)/(8-2) = 6/6 = 1. A slope of 1 means the line rises 1 unit for every 1 unit it moves right — a 45-degree angle. Slope-intercept form: y = mx + b. Substituting the point (2,3): 3 = 1x2 + b. b = 1. Equation: y = x + 1. Parallel lines have the same slope. Perpendicular lines have slopes that multiply to -1 (negative reciprocal): if slope = 3, perpendicular slope = -1/3. Slope as angle: angle = arctan(m). Slope 1 = arctan(1) = 45 degrees. Road grade: a 6% grade means rise of 6 feet per 100 feet of horizontal run = slope of 0.06 = 3.43 degrees.
Tips & Best Practices
- ✓Slope sign interpretation: positive slope = line goes up left to right; negative slope = line goes down left to right; zero slope = horizontal line; undefined slope = vertical line.
- ✓Road grade: US federal guidelines suggest maximum highway grades of 5-6% in mountainous terrain. A 6% grade means a 6-foot elevation gain per 100 feet of horizontal distance.
- ✓Roof pitch: expressed as rise:run (e.g., 4:12 means 4 inches of rise per 12 inches of run). A 4:12 pitch has slope m = 4/12 = 0.333 = 18.4 degrees. Standard residential roofs range from 4:12 to 8:12 pitch.
- ✓Wheelchair ramp ADA standard: maximum slope of 1:12 (1 inch rise per 12 inches run = 8.33% grade). A 24-inch rise requires at minimum a 24-foot ramp.
- ✓Calculus connection: the derivative f'(x) gives the slope of the tangent line to the curve y = f(x) at any point x. The slope calculator is the algebraic version of this differential calculus concept.
- ✓Undefined versus zero slope: division by zero in the slope formula (x1 = x2) means a vertical line with undefined slope. A horizontal line has y1 = y2, giving slope = 0/run = 0.
- ✓Line of best fit: in statistics, linear regression finds the slope and y-intercept of the line that minimises the sum of squared vertical distances from data points to the line.
- ✓Ski slope ratings: the steepness of ski runs is measured by slope percentage. Green runs are typically under 25%; blue runs 25-40%; black diamonds 40%+; double blacks can exceed 70%.
Who Uses This Calculator
Algebra and pre-calculus students solve slope and linear equation problems. Engineers calculate road grades, drainage slopes, and structural inclines. Architects design ramps, stairs, and roof pitches to meet building codes and accessibility standards. Data scientists fit linear regression models and interpret slope coefficients. Physicists calculate rates of change from position-time and velocity-time graphs. Economists interpret marginal cost, marginal revenue, and elasticity as slopes. Surveyors calculate terrain gradients. Skiers and cyclists assess trail and climb gradients.
Optimised for: USA · Canada · UK · Australia · Calculations run in your browser · No data stored
Frequently Asked Questions
What is the slope formula?
Slope (m) = (y₂ - y₁) / (x₂ - x₁). For points (2,3) and (6,7): slope = (7-3)/(6-2) = 4/4 = 1.