standarddeviationcalculator.net

Updated Free · runs in your browser

Slope calculator

--- --- Methodology

The slope of a line is its rise divided by its run: how far it goes up for each unit it goes across. Enter two points, a rise and a run, an angle or a percent grade, and the calculator gives the slope, the percent slope, the angle in degrees, the 1-in-n ratio and, from two points, the equation y = mx + b.

Slope m 3/4
Slope m (rise ÷ run)0.75
Percent grade75%
Angle with the horizontal36.8699°
Ratio rise : run1 : 1.3333 (1 in 1.3333)
DirectionRises left to right
Rise and run3 and 4
Equation of the liney = 0.75x − 0.5
y-intercept b−1/2
Show the working, step by step
  1. Find the rise and the run.

    rise = y₂ − y₁ = 4 − 1 = 3 run = x₂ − x₁ = 6 − 2 = 4

  2. Divide rise by run.

    m = 3 ÷ 4 = 3/4

  3. Percent grade is the slope times 100; the angle is the inverse tangent of the slope.

    grade = 3/4 × 100 = 75% θ = arctan(3/4) = 36.8699°

  4. Put the slope and one point in y = mx + b to find b.

    b = y₁ − m·x₁ = 1 − 3/4 × 2 = −1/2 y = 0.75x − 0.5

The slope formula: rise over run

m = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁)

The run is the horizontal change between two points and the rise is the vertical change. The same number can be written four ways, and the calculator converts between them:

FormFormulaExample for m = 3/4
Gradientm = rise ÷ run0.75
Percent slopem × 10075%
Angleθ = arctan(m)36.8699°
Ratio1 in 1/m1 in 1.3333

Worked example: two points

The calculator starts with the points (2, 1) and (6, 4).

  1. Rise: y₂ − y₁ = 4 − 1 = 3. Run: x₂ − x₁ = 6 − 2 = 4.
  2. Slope: m = 3 ÷ 4 = 0.75.
  3. Percent slope: 0.75 × 100 = 75%.
  4. Angle: arctan(0.75) = 36.8699°.
  5. Intercept: b = y₁ − m·x₁ = 1 − 0.75 × 2 = −0.5, so the line is y = 0.75x − 0.5.

Check with the second point: 0.75 × 6 − 0.5 = 4, which is y₂. For the full menu of line forms (point-slope, general, intercept) use the straight line equation calculator.

How to calculate percent of slope

Percent slope, also called percent grade, is the rise per 100 units of run. A ramp that rises 30 cm over a 360 cm run has a slope of 30 ÷ 360 = 1/12, a percent grade of 8.33333% and an angle of 4.76364°. A road that rises 4 m over 50 m of horizontal distance is 4 ÷ 50 × 100 = 8%. In the other direction, the rise for a given run is rise = grade ÷ 100 × run, so 8% over 50 m is 4 m.

Percent slope and angle are not proportional. 45° is a 100% grade, and 60° is already a 173% grade; the percent keeps climbing without limit as the line approaches vertical, while the angle tops out at 90°.

Slope and angle

m = tan θ θ = arctan(m)

The angle is measured from the horizontal. A negative slope gives a negative angle, for example (0, 3) to (3, 0) has slope −1 and angle −45° (the line falls). For the right triangle behind this, with sides and hypotenuse, see the tangent calculator.

Common mistakes

  • Subtracting in different orders. y₂ − y₁ over x₁ − x₂ gives the wrong sign. Keep the order the same on top and bottom.
  • Run over rise. Slope is rise ÷ run. Run ÷ rise is its reciprocal.
  • Mixed units. Percent grade needs rise and run in the same unit (metres and metres, not centimetres and metres).
  • Treating a vertical line as having slope 0. A horizontal line has slope 0; a vertical line has an undefined slope.
  • Reading 100% as vertical. A 100% grade is 45°.

For a curve rather than a straight line, the slope changes from point to point; the linear approximation calculator finds the slope at one point and uses it to estimate nearby values.

Slope calculator: the worked example on this page, with its result and chart
Slope calculator: the worked example above, at a glance.

Common questions

How do you calculate the slope of a line from two points?

Subtract the coordinates and divide: m = (y₂ − y₁) ÷ (x₂ − x₁). For (2, 1) and (6, 4) the rise is 4 − 1 = 3 and the run is 6 − 2 = 4, so m = 3/4 = 0.75. Subtract in the same order on top and bottom: swapping only one of the two flips the sign.

How do you find rise and run on a graph?

Pick two points where the line crosses grid corners. The run is how many squares you move right to get from the first to the second, and the rise is how many you then move up (down counts as negative). Their ratio, rise ÷ run, is the slope. If the line goes up as you move right the rise is positive; if it goes down the rise is negative.

How do you calculate percent slope (percent grade)?

Divide the rise by the run and multiply by 100: grade % = rise ÷ run × 100. A road that climbs 4 m over a horizontal distance of 50 m has a grade of 4 ÷ 50 × 100 = 8%. To go the other way, divide the percent by 100: an 8% slope is m = 0.08. Both rise and run must be in the same unit.

How do you convert a slope to an angle in degrees?

Take the inverse tangent of the slope: θ = arctan(m). A slope of 3/4 gives arctan(0.75) = 36.87°, and a slope of 1 gives 45°. Going back, m = tan θ. A 100% grade is a 45° angle, not a vertical wall: a vertical line would need an infinite grade.

Why is the slope of a vertical line undefined?

On a vertical line both points have the same x, so the run is 0 and the slope formula divides by zero. The line is written x = a, not y = mx + b, and it makes a 90° angle with the horizontal. A horizontal line is different: its rise is 0, so its slope is 0.