Algebra & geometry

Slope Calculator

Enter two points and get the slope, the angle of inclination, the distance between them, the midpoint and the line written three ways. Or start from a slope and one point and work the other direction. Every result is plotted on a live graph and backed by the working, step by step.

Live graph Shows the steps Exact fractions Runs in your browser
Line equationy = 2x + 1

Point 1 and point 2

  • Slope–intercept–
  • Point–slope–
  • Standard–
Graph of the calculated line with both points and the midpoint plotted on a coordinate plane
PointsMidpointLine
Slope (m)––
Angle of incline–from the x-axis
Distance–between the points
Midpoint–halfway along
Rise & run–Δy over Δx
y-intercept–where x = 0
x-intercept–where y = 0
Grade–slope as a percentage

The working, step by step

    Calculated locally in your browser; nothing is uploaded or stored. Decimal values are rounded for display, while fractions are reduced exactly whenever the coordinates are whole numbers.

    The formula

    How to find the slope of a line

    Slope measures how steeply a line climbs or falls. It is the change in y divided by the change in x, usually said as rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁).

    QuantityFormulaWhat it tells you
    Slopem = Δy ÷ ΔxSteepness and direction. Positive climbs left to right, negative falls, zero is flat.
    Angleθ = arctan(m)The same steepness expressed in degrees from the horizontal axis.
    Distanced = √(Δx² + Δy²)Straight line length between the two points, from the Pythagorean theorem.
    Midpoint((x₁+x₂)/2, (y₁+y₂)/2)The point exactly halfway along the segment.
    Slope–intercepty = mx + bThe most readable form. b is where the line crosses the y-axis.
    Point–slopey − y₁ = m(x − x₁)Fastest form to write when you know the slope and any one point.
    Standard formAx + By = CInteger coefficients, preferred in textbooks and for solving systems.
    Gradegrade = m × 100%Slope as a percentage, the convention used for roads, ramps and roofs.
    Built differently

    Why this slope calculator is better

    Most slope calculators return a decimal and stop. If you are learning this, the decimal is the least useful part.

    It shows the working

    Every step is written out with your numbers substituted in, from subtracting the coordinates to solving for the intercept. That is the part a teacher marks and the part that actually teaches the method.

    A real graph, not a static image

    The line, both points, the midpoint and the intercepts are plotted on an auto-scaled coordinate plane that redraws as you type, so a sign error is visible instantly.

    Exact fractions

    Whole-number coordinates give a reduced fraction such as 3/4 alongside the decimal, because 0.75 is not the answer most homework is looking for.

    Three equation forms at once

    Slope–intercept, point–slope and standard form with integer coefficients, all generated together, so you can hand in whichever the question asked for.

    Handles the edge cases

    Vertical lines return undefined rather than an error or infinity, horizontal lines return zero, and both are explained rather than silently breaking the graph.

    Fast, private, mobile ready

    No accounts, no tracking, no heavy libraries. A few kilobytes of vanilla JavaScript that loads instantly on a phone the night before an exam.

    Step by step

    How to use the slope calculator

    Four steps, and the graph updates as you type.

    1

    Pick your input mode

    Use two points when the question gives you coordinates, or slope and a point when you already know how steep the line is.

    2

    Type the values

    Negatives and decimals are fine. Results and the graph refresh with every keystroke, so there is no calculate button to press.

    3

    Read the equation you need

    Slope–intercept, point–slope and standard form are all listed. Check the graph to confirm the line passes through your points.

    4

    Follow the working

    Read the numbered steps to see exactly how the answer was reached, then copy the whole result into your notes.

    Where slope shows up

    What slope actually measures

    The same number describes a graph in algebra, a ramp on a building site and a trend in a spreadsheet.

    • Rate of change

      On a distance against time graph the slope is speed. On cost against quantity it is price per unit. Slope is always one thing per another thing.

    • Parallel and perpendicular lines

      Parallel lines share a slope. Perpendicular slopes multiply to −1, so the perpendicular to a slope of 2 is −1/2.

    • Ramps and accessibility

      An accessible ramp is typically limited to a 1:12 slope, which is a grade of about 8.3% or roughly 4.8 degrees.

    • Roads and drainage

      Road gradients are quoted as a percentage, while a patio or drain usually needs a minimum fall of about 1% to shed water.

    • Trend lines in data

      The slope of a line of best fit is the average change per unit, which is exactly what a regression coefficient reports.

    • The foundation of calculus

      A derivative is the slope of a curve at a single point, found by shrinking the run toward zero. Everything starts with rise over run.

    Questions

    Slope calculator FAQ

    The questions that come up most when slope stops behaving.

    How do you find the slope between two points?

    Subtract the y-coordinates, subtract the x-coordinates in the same order, then divide. In symbols, m = (y₂ − y₁) ÷ (x₂ − x₁).

    For the points (1, 3) and (4, 9), the rise is 9 − 3 = 6 and the run is 4 − 1 = 3, so the slope is 6 ÷ 3 = 2. The order of the points does not matter as long as you keep it consistent in both subtractions.

    What does a negative slope mean?

    The line falls as you read it left to right, so y decreases while x increases. A slope of −3 means the line drops three units for every one unit you move right. On a rate of change graph, a negative slope means the quantity is shrinking over time.

    Why is the slope of a vertical line undefined?

    Because both points share the same x-coordinate, the run is zero, and division by zero has no value. It is not infinity and it is not zero, it is genuinely undefined. A vertical line is written x = a, and it cannot be expressed in the form y = mx + b at all.

    A horizontal line is the opposite case: the rise is zero, so the slope is exactly 0 and the equation is y = b.

    How do I convert slope to an angle?

    Take the inverse tangent of the slope: θ = arctan(m). A slope of 1 gives 45 degrees, a slope of 0.5 gives about 26.6 degrees, and a slope of 2 gives about 63.4 degrees. Going the other way, m = tan(θ). The relationship is not linear, so doubling the slope does not double the angle.

    What is the difference between slope and grade?

    They measure the same thing in different units. Slope is a ratio, grade is that ratio written as a percentage. A slope of 0.08 is an 8% grade. Roads, ramps and drainage are quoted as grades, while algebra and graphing use the plain ratio.

    How do I write the equation of a line from two points?

    Find the slope first, then substitute one point into y − y₁ = m(x − x₁) to get point–slope form. Expanding and solving for y gives slope–intercept form, y = mx + b, where b = y₁ − m × x₁.

    For (1, 3) and (4, 9) the slope is 2, so b = 3 − 2(1) = 1 and the line is y = 2x + 1. This calculator produces all three standard forms at the same time.

    How do I find a slope perpendicular to another?

    Take the negative reciprocal: flip the fraction and change the sign. Perpendicular to 3 is −1/3, and perpendicular to −2/5 is 5/2. The two slopes always multiply to −1. The exceptions are horizontal and vertical lines, which are perpendicular to each other even though one slope is undefined.

    Can slope be a fraction or a decimal?

    Both are correct, and a fraction is usually preferred in algebra because it is exact. A slope of 2/3 is a repeating decimal, so writing 0.667 loses precision and can shift a graph noticeably over a long run. This calculator shows the reduced fraction alongside the decimal whenever the coordinates are whole numbers.

    Check the line before you hand it in

    Slope, angle, distance, midpoint, intercepts and three equation forms, with the working shown and the graph drawn. Type two points and read the answer.

    Calculate a slope now
    Scroll to Top