Slope Calculator

Use this slope calculator to find slope from two points, rise and run, or y = mx + b, with clear results and easy interpretation.

Calculating...
Did we solve your problem today?

How to use our Slope Calculator

  1. Choose an Input method: Two points, Rise and run, or Slope-intercept equation.
  2. Enter the values shown for that mode only. For Two points, fill in x1, y1, x2, and y2. For Rise and run, fill in Rise and Run. For equation mode, fill in Slope m and y-intercept b.
  3. Pick Decimal places if you want more or less rounding in decimal outputs such as Slope as a decimal, Angle from the positive x-axis, and Grade.
  4. Click Calculate.
  5. Read Slope as a simplified fraction first if you want the exact answer. Then check Slope as a decimal for a rounded version.
  6. Use Slope type to understand the line: positive means it rises left to right, negative means it falls, zero means horizontal, and undefined means vertical.
  7. Check the equation outputs if you need them for class. The tool can show Slope-intercept form, Point-slope form, and Standard form when they are defined.
  8. Sanity-check your result: if x2 is greater than x1 and y2 is also greater than y1, the slope should be positive; if x1 equals x2, the slope should be undefined.

Definitions

Input method: The way you choose to enter the line: Two points, Rise and run, or Slope-intercept equation.

Slope as a simplified fraction: The exact slope written as rise over run in lowest terms.

Slope as a decimal: The slope written as a rounded decimal value.

Slope type: A label that tells whether the line is positive, negative, zero, or undefined.

Rise: The vertical change. Positive means up, negative means down.

Run: The horizontal change. Positive means right, negative means left.

Angle from the positive x-axis: The line's direction in degrees, measured from the rightward horizontal axis.

Grade: Slope written as a percent. For example, 25% means 25 units up for every 100 units across.

Slope-intercept form: An equation written as y = mx + b, where m is slope and b is the y-intercept.

Point-slope form: An equation written as y - y1 = m(x - x1) using one known point and the slope.

Standard form: An equation written as Ax + By = C, often with integer coefficients.

Special case note: A short explanation for horizontal or vertical lines, which need extra care.


Common mistakes and quick fixes

Mistake: Entering the same values for x1, y1 and x2, y2 in Two points mode, which gives only one point instead of a line.
Fix: Change x1, y1, x2, or y2 so the two points are different, then recalculate Slope as a simplified fraction and Slope type.

Mistake: Swapping the order in the slope formula for Two points, such as using y2 - y1 but x1 - x2.
Fix: Keep the same order in both parts. If you use y2 - y1, also use x2 - x1. Then compare the result with Rise and Run shown in Rise and Run outputs.

Mistake: Typing Run as 0 in Rise and run mode and expecting a normal decimal answer.
Fix: A Run of 0 makes the line vertical, so Slope as a decimal is not defined. Read Special case note and Standard form instead.

Mistake: Forgetting the sign on Rise, Run, Slope m, or y-intercept b, especially for negative values.
Fix: Re-enter the minus sign exactly where needed. Then check Slope type and Grade to see whether the line goes downhill or uphill.

Mistake: In Slope-intercept equation mode, entering a full equation into Slope m or y-intercept b instead of just the numbers.
Fix: Enter only the coefficient in Slope m and only the intercept in y-intercept b. For y = 2x - 1, use Slope m = 2 and y-intercept b = -1.

Mistake: Reading Slope as a decimal only and missing the exact value.
Fix: Check Slope as a simplified fraction first. If it says 2/3, that exact value is usually better than a rounded decimal like 0.6667.


Limitations & Key Assumptions / Boundary Conditions

  • The calculator assumes a straight line in a 2D coordinate plane.
  • If the two points are identical, there is no unique line, so the calculator should show an error instead of a slope.
  • If Run = 0 or x1 = x2, the slope is undefined because division by zero is not allowed; decimal slope and grade are not shown as normal numbers.
  • Angle from the positive x-axis is treated as 90 degrees for vertical lines as a special case.
  • Point-slope form is only shown when a usable point is available. In equation mode, the calculator may use the y-intercept point (0, b) and should make that choice clear.
  • Decimal outputs depend on the selected Decimal places setting, so rounded values can look slightly different from exact fractions.
  • Standard form is normalized for clean display, so an equivalent equation may look different from the form your teacher writes.

Methodology

Core idea

Slope tells how much a line goes up or down compared with how far it goes right or left [1][3].

m = (y2 - y1) / (x2 - x1)

m = rise / run

If the denominator is 0, the line is vertical and the slope is undefined [1]. If the numerator is 0 and the denominator is not 0, the slope is 0, so the line is horizontal [4].

How each mode is calculated

Two points: The calculator finds Rise as y2 - y1 and Run as x2 - x1, then divides Rise by Run.

rise = y2 - y1

run = x2 - x1

m = rise / run

Rise and run: The calculator uses the entered Rise and Run directly.

m = rise / run

Slope-intercept equation: In y = mx + b, the slope is m and the y-intercept is b [2].

y = m*x + b

Extra outputs

The exact fraction is simplified by dividing the numerator and denominator by their greatest common divisor. A negative sign is kept in a consistent place so the fraction is easier to read.

grade percent = 100 * rise / run

angle in degrees = atan(m) * 180 / pi

For a vertical line, the angle is shown as 90 degrees as a special case.

When the slope is defined, the calculator can also build common equation forms [2].

y - y1 = m(x - x1)

A = y1 - y2; B = x2 - x1; C = A*x1 + B*y1

A*x + B*y = C

Worked mini-example

Suppose the points are (1, 2) and (4, 5). Then Rise = 5 - 2 = 3 and Run = 4 - 1 = 3.

m = (5 - 2) / (4 - 1) = 3 / 3 = 1

So the slope fraction is 1, the decimal is 1.0000 if 4 decimal places are chosen, the grade is 100%, and the angle is 45 degrees.

The line equation in slope-intercept form is y = x + 1 because a line with slope 1 through (1, 2) crosses the y-axis at 1.

Assumptions behind the results

This calculator uses exact line formulas and then rounds only the displayed decimals. Real classwork may accept equivalent equation forms, different but equal standard forms, or different rounding rules. Vertical lines do not have a defined slope-intercept form, so the calculator shows special-case equations instead.


Sources