m = Δy ÷ ΔxReviewed 28 Sep 2026Runs in your browser

Slope Calculator

Find the slope of a line from two points, a point and a slope, an angle and intercept, or an equation Ax + By = C — with the percent grade, angle of inclination, roof pitch, distance, intercepts and all three line-equation forms, plus a graph.

Who wrote it

Written by Suhaib Hassan. Every formula is standard coordinate geometry, and the worked examples are re-derived by hand. Our methodology.

How the engine works

It computes rise over run, reduces it to an exact fraction where possible, takes the arctangent for the angle, and builds the line’s equation in three forms.

Why we built it

Slope shows up as grade, pitch and angle in construction and maths. One page converts between all of them and handles vertical lines correctly.

Two points

Presets
Live formulation—
Slope (m)—
—

—

Exact fraction—
Percent grade—

Graph of the line

The line with its intercepts marked.

—

Step-by-step working

—

—

    Types of slope

    How the sign and size of m describe a line.

    LineSlope mAngle θDescriptionEquation
    Positivem > 00° < θ < 90°Rises from left to righty = mx + b
    Negativem < 0−90° < θ < 0°Falls from left to righty = mx + b
    Zero (horizontal)m = 0θ = 0°Perfectly levely = b
    Undefined (vertical)Δx = 0θ = 90°Straight up and downx = a
    Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1 (m₁ × m₂ = −1), i.e. m₂ = −1 ÷ m₁.

    Slope in the real world

    Wheelchair ramps

    US accessibility standards (ADA) set a maximum running slope of 1:12 for ramps.

    1 ÷ 12 = 0.0833 = 8.33% grade
    θ = arctan(1/12) = 4.76°

    Road drainage

    Pavements are crowned or cambered so that water runs off; cross slopes of about 1.5–2% are common.

    2 ft drop over 100 ft = 2% = 1.15°

    Roof pitch

    Pitch is quoted as rise per 12 units of run: “6 in 12” means 6 inches of rise per foot.

    6 ÷ 12 = 0.5 → 26.57°, 50% grade

    What is slope?

    Slope measures how steep a line is: the vertical change (rise) divided by the horizontal change (run) between any two points on it, m = (y₂ − y₁) ÷ (x₂ − x₁). It is the same for every pair of points on a straight line. Slope is the tangent of the angle the line makes with the x-axis, m = tan θ.

    Three ways to write a line

    • Slope-intercept: y = mx + b, where b is the y-intercept.
    • Point-slope: y − y₁ = m(x − x₁), for a known point (x₁, y₁).
    • Standard form: Ax + By = C, with the slope −A ÷ B and y-intercept C ÷ B.

    Grade, angle and pitch

    Percent grade = slope × 100. The angle is arctan(slope). A roof pitch of “n in 12” has slope n ÷ 12. A 100% grade is a 45° incline.

    By Suhaib Hassan · Reviewed 28 September 2026 · How CalculatePilot verifies formulas →

    Sources

    • Descartes, R. (1637). La Géométrie — the foundation of coordinate geometry.
    • US Access Board, 2010 ADA Standards for Accessible Design, section 405 (ramps) — maximum running slope 1:12.
    • ISO 80000-2:2019, Quantities and units — Part 2: Mathematics.

    Frequently asked questions

    Why is the slope of a vertical line undefined?

    A vertical line has Δx = 0, so the slope formula divides by zero. Its angle is 90° and its equation is x = a, rather than y = mx + b.

    How is slope related to the derivative?

    The derivative dy/dx is the slope of the tangent line to a curve at a point. For a straight line the slope is constant, so the derivative equals m everywhere.

    What is the difference between percent slope, degrees and roof pitch?

    They are the same steepness in different units. Percent slope is 100 × rise ÷ run; degrees are arctan(rise ÷ run); pitch is rise per 12 units of run. A 12% slope is 6.84°, or a pitch of 1.44 in 12. They are not proportional: 100% slope is 45°, not 100°.

    How do I find a perpendicular or parallel slope?

    A parallel line has the same slope m. A perpendicular line has slope −1 ÷ m (the negative reciprocal). If m = 0 the perpendicular line is vertical, and vice versa.

    How do I convert Ax + By = C to y = mx + b?

    Solve for y: y = (−A ÷ B)x + C ÷ B, provided B ≠ 0. If B = 0 the line is vertical at x = C ÷ A.

    Can slope be a fraction or a decimal?

    Yes. Slope is any real number. It is often best left as an exact fraction such as 2/3, because the decimal 0.6667 is only an approximation.

    Related calculators

    Continue with coordinate geometry.

    All Math Calculators

    Embed This Slope Calculator

    Free and responsive, and it runs in the visitor's browser. Branding removal from $7.99/month.

    <iframe src="https://www.calculatepilot.com/embed/slope-calculator.html" width="100%" height="560" loading="lazy" title="Slope Calculator"></iframe>
    For website owners

    Want this calculator on your own website?

    Embed it in one line of code. Keep it free with a small CalculatePilot attribution link, or go white-label: your brand, no attribution, one license for all your domains.

    • All 159 calculators, unlimited embeds
    • Works on WordPress, Webflow, Squarespace, Wix and plain HTML
    • Runs in your visitor's browser, so nothing is sent to a server
    • License key emailed automatically after checkout, cancel anytime
    $7.99 / month
    or $89.99 / year · white-label Pro
    Get the white-label license Embed free with attribution