Slope Calculator
Enter the coordinates of two points. The calculator returns the slope as a number, a percentage and an angle, plus the distance between the points and the line equation.
Result
- Percent grade
- 200%
- Angle of inclination
- 63.4349°
- Distance between the points
- 6.708204
- Midpoint
- (2.5, 5)
- Rise and run
- 6 over 3
- y-intercept
- 0
- x-intercept
- 0
Formula
- m = (y₂ − y₁) ÷ (x₂ − x₁)
- Percent grade = m × 100
- Angle = arctan(m)
- Distance = √((x₂ − x₁)² + (y₂ − y₁)²)
- Midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
- y = mx + b, where b = y₁ − m × x₁
How the Slope Calculator works
Slope measures steepness as rise over run: the change in y for each unit of change in x. A positive slope climbs from left to right, a negative slope falls, a zero slope is flat and a vertical line has no defined slope.
The same number can be written as a percent grade, used for roads and ramps, or as an angle. A slope of 1 is a 100 percent grade and a 45 degree angle.
Worked example
Between (1, 2) and (4, 8): m = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2. The line is y = 2x + 0, the distance is √(3² + 6²) = 6.7082 and the midpoint is (2.5, 5).
Frequently asked questions
How do I convert slope to a percentage?
Multiply by 100. A rise of 1 foot over a run of 12 feet is a slope of 0.0833, or an 8.33 percent grade, the maximum for an ADA wheelchair ramp.
What is the slope of a horizontal and a vertical line?
A horizontal line has a slope of 0. A vertical line has an undefined slope, because the run is zero.
Related calculators
- Pythagorean Theorem CalculatorFind the missing side of a right triangle with the Pythagorean theorem. Also gives the area, perimeter and both acute angles.
- Quadratic Formula CalculatorSolve ax² + bx + c = 0 with the quadratic formula. Gives real or complex roots, the discriminant, the vertex and the steps.
- Rafter Length CalculatorCalculate common rafter length, roof rise and angle from the building span, roof pitch, ridge thickness and overhang.
- Roofing Shingle CalculatorCalculate roof area, roofing squares and bundles of shingles from the building footprint and roof pitch.
- Ratio CalculatorSimplify a ratio, solve for a missing value in A : B = C : D, or split a total in a given ratio. Works with whole numbers and decimals.
- Proportion CalculatorSolve a proportion a/b = c/d for the missing value by cross-multiplication. Enter any three of the four numbers.
- Factor CalculatorFind all factors of a number, its factor pairs and its prime factorization. Also tells you whether the number is prime.
- GCF Calculator (Greatest Common Factor)Find the greatest common factor of two or more numbers, with the Euclidean algorithm steps and prime factorizations. Also gives the LCM.
- LCM Calculator (Least Common Multiple)Find the least common multiple of two or more numbers, with prime factorizations. Also gives the greatest common factor.
- Rounding CalculatorRound a number to the nearest whole number, tenth, hundredth, thousandth, ten, hundred or thousand. Exact decimal rounding with no floating point errors.
- Significant Figures CalculatorCount the significant figures in a number and round it to any number of significant figures, with scientific notation.
- Modulo CalculatorCalculate a mod n, the remainder after division, with the quotient. Handles negative numbers under both the mathematical and programming conventions.
Related unit converters
Calculations run in your browser and nothing you enter is sent to a server. Results are provided for general information. Check critical figures independently before relying on them.