Skip to main content

Slope Calculator


Enter two points to compute the slope using m = (y? ? y?) / (x? ? x?). All coordinates are required.

Note: If x? = x?, the slope is undefined (vertical line). Use different x-values.

Quickly find the slope of a line from two points with this Slope Calculator. Enter coordinates, press calculate, and instantly see the slope, the line equation, and more.

What is slope?

The slope of a line measures its steepness and direction. It’s defined as the ratio of the change in y to the change in x between two points on the line. Mathematically, slope m is computed as m = (y? ? y?) / (x? ? x?). A positive slope rises as you move right, a negative slope falls, a zero slope is horizontal, and an undefined slope corresponds to a vertical line.

How to use the Slope Calculator

  1. Enter the first point (x?, y?).
  2. Enter the second point (x?, y?).
  3. Optionally choose how many decimal places to round to.
  4. Click Calculate Slope to see results instantly.

The calculator returns the slope, the change in x and y (?x and ?y), the angle of the line in degrees (relative to the positive x-axis), and the line equation in slope-intercept form when applicable.

Formula and interpretation

The core formula is straightforward: m = ?y / ?x. Here, ?y = y? ? y? and ?x = x? ? x?. If ?x = 0, the line is vertical and the slope is undefined. If ?y = 0, the slope is 0 and the line is horizontal. The angle ? of the line with respect to the x-axis can be found using ? = arctan(m), reported in degrees.

Examples

  • Points (1, 2) and (4, 8): ?y = 6, ?x = 3, so m = 6/3 = 2. The line rises 2 units for every 1 unit to the right.
  • Points (?3, 5) and (?3, ?1): ?x = 0, so the line is vertical and slope is undefined. The equation is x = ?3.
  • Points (0, 7) and (5, 7): ?y = 0, so m = 0. The line is horizontal with equation y = 7.

Line equation from two points

Once you know the slope m, you can write the equation in slope-intercept form y = mx + b. Solve for b using either point: b = y? ? m·x?. For vertical lines (x? = x?), the slope-intercept form doesn’t apply; instead, use x = c, where c is the shared x-value.

Why use this Slope Calculator?

  • Fast and accurate slope from any two points.
  • Clear display of ?x, ?y, angle, and line equation.
  • Adjustable rounding to match classroom or professional standards.
  • Helpful notes for special cases like vertical and horizontal lines.

Tips for accurate inputs

  • Avoid identical x-values if you need a numeric slope; that produces a vertical line.
  • Double-check signs on negative coordinates.
  • Use more decimal places for engineering or scientific precision.

Common applications

Slope appears in algebra, calculus, physics, engineering, and data analysis. It’s used to describe rates of change, grade (steepness) of roads and roofs, trend lines in statistics, and projectile motion trajectories. Whether you’re graphing a line, analyzing a dataset, or checking a ramp’s incline, knowing how to compute and interpret slope is essential.

Frequently encountered edge cases

Vertical lines (x? = x?) are common when two points share the same x-coordinate; their slope is undefined, and the equation is x = c. Horizontal lines (y? = y?) produce slope 0 with equation y = c. For very small ?x values, slope can be extremely large in magnitude; consider increasing decimal precision to reduce rounding error.


FAQs

How does the Slope Calculator find the slope from two points?

It applies m = (y? ? y?) / (x? ? x?) and displays ?x, ?y, slope, angle, and the line equation.

What happens in the Slope Calculator if x? equals x??

?x becomes 0, so slope is undefined. The calculator reports a vertical line: x = constant.

Can the Slope Calculator show the line equation?

Yes. It returns y = mx + b when the slope is defined, or x = c for vertical lines.

Does the Slope Calculator handle negative coordinates?

Absolutely. Enter any real values; the calculator works with positives, negatives, and decimals.

Can I control rounding in the Slope Calculator results?

Yes. Use the optional decimal places field to set rounding from 0 to 10 places.

Will the Slope Calculator provide the angle of the line?

Yes. It computes the angle ? in degrees using ? = arctan(m).

Is the Slope Calculator suitable for horizontal lines?

Yes. If y? = y?, slope is 0 and the calculator shows the equation y = constant.

What inputs are required by the Slope Calculator?

Four numbers: x?, y?, x?, y?. Decimal places are optional.