Slope Calculator

Calculate slope, line equations, angle of inclination, distance between points, intercepts, and graph visualizations with step-by-step coordinate-geometry solutions.

Slope From Two Points

Enter two (x, y) coordinates. Get the slope, angle of inclination, distance, midpoint, intercepts, and the line equation in four forms — with a full step-by-step solution.

Try an example

What is slope, and why does it matter?

The slope of a line — also called the gradient, grade, or incline — is the single number that captures how steeply a line rises or falls as you move along it. Slope is the bridge between algebra and geometry: it is the ratio at the heart of linear equations, the slope-intercept form, the point-slope form, and every coordinate proof in introductory geometry. The same concept underlies physical quantities like road grade, roof pitch, the steepness of a ski run, the strength of a trend line on a chart, and even the marginal rate of change in economics.

This tool pairs five focused calculators with a live coordinate-plane graph so you can solve the slope from two points, find a missing endpoint from a starting point and a distance, convert a line equation between four standard forms, analyze distance and direction, or explore coordinate geometry by dragging points directly on the plane. Each answer is shown with a full step-by-step solution and cross-linked to the other forms of the same line. For broader math help, see our scientific calculator and percentage calculator.

How the slope calculator works

Reads your inputs

Enter the coordinates of the two points (or a starting point plus a distance and slope/angle). Decimals, negatives, and simple fractions like 3/4 are all accepted.

Computes Δx, Δy, and slope

The calculator subtracts the x-coordinates to get Δx (the run) and the y-coordinates to get Δy (the rise), then divides — m = Δy / Δx.

Derives angle and distance

Angle of inclination comes from θ = arctan(m). Distance comes from the Pythagorean theorem d = √(Δx² + Δy²). Midpoint averages each coordinate independently.

Builds the line equation

Once the slope and one point are known, the calculator produces the line equation in slope-intercept, point-slope, standard, and general form — and computes both intercepts.

Five ways to use this slope calculator

1

Slope From Two Points

Enter two (x, y) coordinates. Get the slope, angle of inclination, distance, midpoint, intercepts, and the line equation in four forms — with a full step-by-step solution.

2

Point + Slope Calculator

Start from one point plus a distance and either the slope or the angle of inclination. The calculator returns both forward and backward endpoint solutions — the two valid points on the same line at that distance.

3

Line Equation Calculator

Build a line from slope and y-intercept, or from a point plus slope. Get the equation in slope-intercept, point-slope, standard (Ax + By = C), and general (Ax + By + C = 0) form.

4

Distance & Angle Calculator

Focus on the distance, angle, direction, and quadrant of the displacement vector from P₁ to P₂ — useful for navigation, surveying, and physics problems.

5

Coordinate Geometry Explorer

Drag the two points directly on the coordinate plane. Every value — slope, angle, distance, midpoint, intercepts, line equation — updates live as you move the points.

Core coordinate-geometry formulas

Every result on this page comes from one of the formulas below. Cross-reference them whenever you want to check a step by hand.

Slope

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

Rise over run. Subtract y-coordinates for the rise and x-coordinates for the run; divide.

Angle of Inclination

θ = arctan(m)

The angle the line makes with the positive x-axis. A slope of 1 is 45°; a vertical line is 90°.

Distance

d = √((x₂ − x₁)² + (y₂ − y₁)²)

The Pythagorean theorem applied to the Δx and Δy legs of the right triangle.

Midpoint

M = ((x₁ + x₂)/2, (y₁ + y₂)/2)

The exact centre of the segment — the average of each coordinate.

Slope-Intercept

y = mx + b

Solve for b once you have the slope and one point: b = y₁ − m·x₁.

Point-Slope

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

Always available with one point and a slope — no need to compute the intercept first.

Best practices for slope problems

  • Stay consistent with the point order. Whichever point you call P₁, the same point's coordinates must go in the numerator and the denominator of the slope formula. Swapping mid-calculation is the most common student error.
  • Sketch before you solve. Even a rough mental sketch tells you whether to expect a positive, negative, zero, or undefined slope — and catches sign errors before they cascade.
  • Cross-check with the angle. Compare the slope with the angle of inclination — a slope of 1 should always read 45°, slope √3 should read 60°, and a vertical line should read 90°.
  • Use the right form for the question. Point-slope is fastest when you have one point. Slope-intercept is best for graphing. Standard form is the convention for linear-algebra and constraint problems.
  • Watch for vertical lines. A vertical line has undefined slope and is written as x = constant — it cannot be expressed in slope-intercept form. The calculator flags this for you automatically.

Why slope matters in the real world

Slope is one of those quietly universal ideas — it has the same algebraic form whether you are calculating a roof pitch for a contractor, a road grade for a traffic engineer, a marginal cost in economics, a velocity from a position graph in physics, or the rate at which a population, temperature, or revenue figure is changing. Every linear relationship in mathematics, science, and engineering can be reduced to a slope plus a starting value.

Even the angle of inclination shows up in surprising places — surveyors quote hillside angles to lay out roads safely, civil engineers express ramp slopes as degrees to satisfy ADA accessibility codes, roofers quote pitches as a 4-in-12 ratio that translates back to a roof-angle calculation, and skiers see slope percentage on every signed run. Getting comfortable with rise-over-run pays off far beyond the algebra classroom.

Tricky cases the calculator handles

Vertical lines (undefined slope)

When x₁ = x₂, Δx = 0 and the slope is undefined. The calculator reports 'undefined', sets the angle to 90°, and switches the equation to the x = constant form. Slope-intercept form does not exist for vertical lines.

Horizontal lines (zero slope)

When y₁ = y₂, Δy = 0 and the slope is exactly zero. The angle of inclination is 0°. The y-intercept is the same as the constant y-value; there is generally no x-intercept (unless the line lies along the x-axis itself).

Identical points

If both points coincide, no unique line passes through them. The calculator flags this and asks you to spread the points apart — distance is zero and slope is indeterminate.

Both endpoint solutions in Point + Slope mode

From one anchor point, a slope and a distance specify a line, not a single endpoint — there are always two valid endpoints, one in each direction. The calculator returns both so you can pick the one your problem needs.

Common slope mistakes (and how to avoid them)

Swapping the order of subtraction

If you write (y₂ − y₁) in the numerator, you must write (x₂ − x₁) in the denominator. Mix the order and the slope sign flips. The fix: always pick a P₁ and a P₂, then stick with that labelling all the way through.

Confusing Δx and Δy

Δy is the rise (the vertical change); Δx is the run (the horizontal change). Plotting them in the wrong slots gives the reciprocal of the correct slope — a classic algebra-test trap.

Forgetting to check for vertical lines

Dividing by Δx without checking that it isn't zero gives a runtime error or, worse, a silently wrong answer. The calculator handles this for you, but on paper you should always check Δx first.

Reading angle of inclination wrong

Negative slopes give angles in the (90°, 180°) range, not negative angles. The calculator normalizes the angle to 0°–180° (or 0°–360° for the Point + Slope mode where direction matters).

Built for students, teachers, engineers, and CAD designers.

Every formula on this page is the textbook coordinate-geometry definition. Calculations use double-precision floating-point — accurate to roughly 15 digits. See our methodology and editorial policy. Educational only — confirm safety-critical engineering or surveying figures with a licensed professional.

Frequently asked questions

Slope is the steepness or gradient of a straight line on a coordinate plane — the ratio of vertical change (Δy, the rise) to horizontal change (Δx, the run) between any two points on the line. A line with slope 2 climbs two units up for every one unit it moves to the right; a line with slope −0.5 falls half a unit for every unit it moves right.

Use the formula m = (y₂ − y₁) ÷ (x₂ − x₁). Subtract the y-coordinates to get the rise, subtract the x-coordinates in the same order to get the run, and divide. The order of the points does not matter as long as you stay consistent in both the numerator and the denominator.

A positive slope means the line rises from left to right — as x increases, y increases. The larger the positive value, the steeper the climb: a slope of 0.1 is a gentle ramp, a slope of 1 is a 45° diagonal, and a slope of 10 is nearly vertical.

A negative slope means the line falls from left to right — as x increases, y decreases. The more negative the value, the steeper the descent. Negative slopes appear in depreciation curves, decay models, and any situation where one quantity decreases as another increases.

The angle of inclination θ is the angle the line makes with the positive x-axis, measured counter-clockwise. It is found by θ = arctan(m), where m is the slope. A slope of 1 corresponds to 45°, slope 0 corresponds to 0° (horizontal), and a vertical line is 90° (undefined slope).

Use the Pythagorean-derived distance formula d = √((x₂ − x₁)² + (y₂ − y₁)²). The two coordinate differences form the legs of a right triangle, and the distance is the hypotenuse. From (1, 1) to (4, 5) the distance is √(3² + 4²) = √25 = 5.

The midpoint is the exact centre of the line segment connecting two points. Average each coordinate independently: M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2). For (2, 4) and (8, 10), the midpoint is (5, 7).

Find the slope m, then use point-slope form: y − y₁ = m(x − x₁). Rearrange to slope-intercept form y = mx + b by solving for y. The y-intercept is the constant; the x-intercept is found by setting y = 0 and solving for x.

Rise over run is the conceptual definition of slope: the vertical change (rise) divided by the horizontal change (run) between two points on a line. It is the bridge between the algebraic formula m = Δy / Δx and the visual picture of stepping along a staircase.

The mathematics is exact — slope, distance, midpoint, intercepts, and angle of inclination are computed in double-precision IEEE 754 floating point, which keeps roughly 15 significant digits. Vertical lines correctly report undefined slope and a 90° angle. Identical points correctly report zero distance and an indeterminate slope.