Popular right now

Calculators

Slope Calculator

Enter two points or an equation to get the slope with full working, the line in every standard form and a graph — or convert between grade, angle and roof pitch.

Ready to useFree · No sign-up
Find the slope from

Decimals, negatives and fractions (3/4, −1 1/2) all work.

m = 3/4

= 0.75 as a decimal

m = (y₂ − y₁) / (x₂ − x₁)

m = (7 − 1) / (10 − 2)

m = 6 / 8 = 3/4

b = y₁ − m·x₁ = 1 − (3/4) × 2 = −1/2

Slope (m)3/4
Slope as a decimal0.75
Angle with the x-axis36.8699°
Grade75%
Slope-intercept formy = (3/4)x − 1/2
Point-slope formy − 1 = 3/4(x − 2)
Standard form3x − 4y = 2
x-intercept(2/3, 0)
y-intercept(0, −1/2)
Rise (Δy) / run (Δx)6 / 8
Distance between points√(8² + 6²) = 10
Midpoint(6, 4)
246810−22468(2, 1)(10, 7)

Dashed: the run (horizontal) and rise (vertical) between the two points.

Calculated on your device — nothing is sent anywhere.

Works in your browser. No account needed.

Advertisement

Frequently asked questions

How do you find the slope between two points?

Divide the change in y by the change in x: m = (y₂ − y₁) / (x₂ − x₁), often remembered as rise over run. For the points (2, 1) and (10, 7), m = (7 − 1) / (10 − 2) = 6/8 = 3/4 = 0.75. It does not matter which point you call the first, as long as you subtract in the same order on the top and the bottom.

What is the difference between a zero slope and an undefined slope?

A horizontal line has a slope of 0 because the rise is zero — y never changes, and the equation has the form y = k. A vertical line has an undefined slope because the run is zero and division by zero is not possible; its equation has the form x = k and it has no y-intercept unless it is the y-axis itself.

How do I convert a slope to an angle or a percent grade?

The angle with the x-axis is the arctangent of the slope, θ = arctan(m), and the percent grade is the slope times 100. A slope of 3/4 is a 75% grade at an angle of about 36.87°. A 100% grade is a 45° angle, not a vertical wall, because the rise equals the run.

What is the maximum slope for a wheelchair ramp?

Under the 2010 ADA Standards for Accessible Design, §405.2, a ramp’s running slope must not be steeper than 1:12 — one unit of rise for every 12 units of run, which is 8.33% or about 4.76°. §405.6 limits each ramp run to a rise of 30 inches, so a full-height run at 1:12 is 30 feet long before a landing is needed. Walking surfaces of 1:20 (5%) or less are not classed as ramps.

How does roof pitch relate to slope?

Roof pitch is written as the inches of rise per 12 inches of run, such as 6/12 or “6 in 12”. Divide by 12 to get the slope: 6/12 is a slope of 0.5, a 50% grade and an angle of about 26.57°. A 4/12 roof is about 18.43°, and a 12/12 roof is exactly 45°. The Grade & roof pitch tab converts in both directions.

What are slope-intercept, point-slope and standard form?

They are three ways to write the same line. Slope-intercept form, y = mx + b, shows the slope and the y-intercept. Point-slope form, y − y₁ = m(x − x₁), is built directly from a known point and the slope. Standard form, Ax + By = C, uses whole-number coefficients and also handles vertical lines. For the line through (2, 1) and (10, 7) they are y = (3/4)x − 1/2, y − 1 = 3/4(x − 2) and 3x − 4y = 2.

Advertisement

About this tool

This slope calculator does more than divide rise by run. Enter two points and it returns the slope as an exactly simplified fraction and as a decimal, the angle the line makes with the x-axis, the distance between the points and their midpoint, both intercepts, and the equation of the line in slope-intercept, point-slope and standard form. A graph draws the line through your points with the rise and run marked, so a sign error or a swapped coordinate stands out immediately.

Coordinates are handled as exact fractions rather than floating-point numbers. That means the points (0.1, 0.2) and (0.3, 0.8) give a slope of exactly 3 rather than 2.9999999999999996, fractions such as 1/3 can be typed directly, and the standard form always comes out with the smallest whole-number coefficients. You can also start from an equation instead of points: type y = 3x − 2, 2x + 3y = 6, y − 4 = −1/2(x + 2) or x = 5, and the calculator rearranges it and reports the same set of results, with the step from standard form to slope and intercept written out.

The Grade & roof pitch tab is for building and outdoor work. Enter a rise and a run, a percent grade, an angle, or a roof pitch in the x/12 form and it converts to all the others, along with the 1:n ratio used for ramps. For ramps it checks the result against the 2010 ADA Standards for Accessible Design: §405.2 caps the running slope of a ramp at 1:12 (8.33%), and §405.6 limits each run to a 30-inch rise. For a 30-inch rise that means at least 360 inches — 30 feet — of horizontal run. Local building codes can be stricter, so treat the check as a first pass.

Worked example: a road climbs 42 m over a horizontal distance of 600 m. The slope is 42/600 = 7/100 = 0.07, a 7% grade at an angle of about 4.00°. Worked example: a shed roof rises 18 inches over a 48-inch run. The slope is 18/48 = 3/8, which is a pitch of 4.5/12, a 37.5% grade and an angle of about 20.56°. Everything runs in your browser — nothing is uploaded or stored.

Related tools