Slope Calculator
Calculate the slope between two points, convert between gradient, percentage and degrees, and get the line equation.
Need this done properly for your business?
Radiatus delivers secure cloud, DevOps & compliance engineering.
Rise over run
Slope is the change in y divided by the change in x: (y₂ − y₁) / (x₂ − x₁). Positive means the line rises left to right, negative means it falls, zero means horizontal. A vertical line has an undefined slope rather than an infinite one, because the denominator is zero — which is why vertical lines cannot be written in y = mx + b form and need x = k instead.
Three ways to express the same steepness
A gradient of 0.5 is a ratio. As a percentage it is 50 percent, which is gradient times 100. As an angle it is arctan(0.5) ≈ 26.6 degrees. These are not interchangeable, and the confusion is common: a 100 percent grade is 45 degrees, not vertical. Road signs use percentage, roofing uses rise-per-12-inches, and mathematics uses the ratio.
Getting the line equation
With a slope and one point, point-slope form gives y − y₁ = m(x − x₁), which rearranges into y = mx + b. The intercept b is where the line crosses the y-axis, found by substituting either point back in. Two points are enough to define a line completely, which is why the slope calculation and the equation always come together.
Parallel and perpendicular
Parallel lines have equal slopes. Perpendicular lines have slopes whose product is −1, so a line of slope 2 is perpendicular to one of slope −1/2. The negative reciprocal rule fails only for horizontal and vertical pairs, where one slope is zero and the other undefined — they are perpendicular, but the product rule cannot express it.
Practical gradients
Accessible ramps are commonly limited to 1:12, about 8.3 percent. Drainage typically wants a minimum fall of 1 to 2 percent so water moves without standing. Wheelchair-accessible paths, road maximum grades and roof pitches all use different conventions for the same underlying number, so checking which convention a specification uses matters more than the arithmetic.
Slope is a rate of change anywhere
Outside geometry, the slope of a line through two data points is the average rate of change between them — miles per hour, cost per unit, growth per year. That is also the foundation of the derivative, which is the slope as the two points converge. A regression line's slope is the same idea fitted across many points rather than two.
Frequently Asked Questions
Privacy & Security
All processing happens locally in your browser — nothing is uploaded.
How to Use
Enter the coordinates of two points to get slope, angle, distance and the line equation.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
Percentage Calculator
MathCalculate percentages, percentage change, increase and decrease, and reverse percentages, with the working shown for each result.
Statistical Calculator
MathCalculate mean, median, mode, standard deviation, and more.
Probability Calculator
MathCalculate probabilities for single and combined events, including conditional probability and Bayes' theorem.