Slope Calculator

Find the slope of the line through two points as an exact fraction, with its angle and the equation in slope-intercept, point-slope and standard form. Also gives the intercepts, midpoint and distance, drawn with the rise and run.

Calculator Numbers & Math Updated Oct 3, 2026
How to Use
  1. Choose two points, or point and slope if you already know the slope (a fraction like 2/3 or a grade like 8% works).
  2. Type the coordinates. Decimals and fractions are fine.
  3. Read the slope as an exact fraction, the equation, the angle and the distance.
  4. The table gives all three forms of the equation, the intercepts, the grade, the perpendicular slope and the midpoint.
  5. The graph shows the line with the run (blue) and the rise (green) between the points.
Input
2/3 or 8%
Presets
Rise over run
Slope m
—
Equation
—
Angle
—
Distance
—

Worked Example

Through (−2, 3) and (4, −1). Rise: −1 − 3 = −4. Run: 4 − (−2) = 6. Slope m = −4/6 = −2/3. The intercept is b = 3 − (−2/3)(−2) = 3 − 4/3 = 5/3, so y = −2/3x + 5/3; multiplying by 3 gives the standard form 2x + 3y = 5.

Speed as a slope. A car at 120 miles after 2 hours and 300 miles after 5 hours has slope (300 − 120) ÷ (5 − 2) = 180 ÷ 3 = 60 miles per hour.

The common mistake: subtracting in different orders. (−1 − 3) ÷ (−2 − 4) = −4 ÷ −6 = +2/3 has the wrong sign. Take both differences from the same point: (y₂ − y₁) over (x₂ − x₁).

Show Work

Enter two points to see the step-by-step working.

Formulas

Slope
m = (y₂ − y₁) ÷ (x₂ − x₁)
Slope-intercept
y = mx + b
Point-slope
y − y₁ = m(x − x₁)
Standard
Ax + By = C
Angle and grade
θ = arctan m, grade = 100m %
Perpendicular
m₁ × m₂ = −1

Why the Letter m?

Nobody knows for sure. The use of m for slope appears in English textbooks in the 19th century, and the common story that it comes from the French monter, to climb, has no real evidence behind it. Other countries use other letters: k in much of Europe and Asia, a in some textbooks.

The idea itself comes from coordinate geometry, invented independently by René Descartes and Pierre de Fermat in the 1630s, which let a straight line be written as an equation. Slope then became the bridge to calculus: the derivative is the slope of a curve at a single point.

About This Calculator

This calculator works out the slope of a line from two points, or completes the line from a point and a slope (including road grades in percent). It keeps everything as exact fractions, gives the line in slope-intercept, point-slope and whole-number standard form, and finds the intercepts, the perpendicular slope, the midpoint and the exact distance.

Everything runs in your browser; nothing is sent anywhere.

Related calculators: Distance Calculator, Graphing Calculator, and Trigonometry Calculator.

Frequently Asked Questions

How do I find the slope between two points?

Divide the change in y (the rise) by the change in x (the run): m = (y₂ − y₁) ÷ (x₂ − x₁). From (−2, 3) to (4, −1) the rise is −4 and the run is 6, so m = −4/6 = −2/3: the line falls 2 units for every 3 to the right. It doesn’t matter which point you call first, as long as you subtract in the same order top and bottom.

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

Three ways of writing the same line. Slope-intercept, y = mx + b, shows the slope and where the line crosses the y-axis. Point-slope, y − y₁ = m(x − x₁), uses any known point. Standard form, Ax + By = C with whole numbers, is handy for intercepts and systems of equations: y = −2/3x + 5/3 is 2x + 3y = 5.

What is the slope of a vertical or horizontal line?

A horizontal line has slope 0: the rise is 0 however far you go. A vertical line has an undefined slope, because the run is 0 and you can’t divide by zero; its equation is x = constant, such as x = 2.

How do slope, angle and grade relate?

The slope is the tangent of the angle the line makes with the x-axis: angle = arctan(m). A slope of 1 is 45°; a slope of 2 is 63.43°. Grade is the slope as a percentage, used for roads and ramps: an 8% grade is a slope of 0.08, an angle of 4.57°.

How do I find a perpendicular or parallel line?

Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1, so the perpendicular slope is the negative reciprocal: for m = −2/3 it is 3/2. A vertical line is perpendicular to any horizontal one.

How do I use the Slope Calculator?

Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Does it cost anything or need an account?

No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.

Is anything I type uploaded?

No. The tool works entirely on your device, so the values you enter never leave your browser.

Common Use Cases

Homework

(1, 2) and (4, 8): slope 2, y = 2x, distance 3√5.

Roads and ramps

An 8% grade is a slope of 0.08 and an angle of 4.57°.

Rates

From 120 miles at 2 h to 300 miles at 5 h: 60 mph.

Roofs

A 6-in-12 pitch is slope 1/2, 26.57°.

Perpendiculars

A line perpendicular to slope −2/3 has slope 3/2.

Last updated: