Slope Calculator

Enter two points to calculate slope, rise, run, and the line equation.

Enter the x-coordinate of the first point.
Enter the y-coordinate of the first point.
Enter the x-coordinate of the second point.
Enter the y-coordinate of the second point.

Slope

2

Rise8
Run4
Line equationy = 2x + 0

How to use this slope calculator

  1. Enter the first point

    Type the coordinates of the first point into the x1 and y1 fields.

  2. Enter the second point

    Type the coordinates of the second point into the x2 and y2 fields.

  3. Read the slope

    The calculator divides rise by run to return the slope of the line through both points.

  4. Check rise and run

    Review the Rise and Run values to see the vertical and horizontal changes separately.

  5. Note the line equation

    Use the Line equation output to see the full slope-intercept form y = mx + b.

Methodology

How this slope calculator works

This calculator subtracts the y-values to get rise, subtracts the x-values to get run, and divides rise by run to find slope. It also expresses the corresponding line in slope-intercept form where possible, which is useful for algebra, graphing, and coordinate geometry work.

Formula
slope = (y₂ − y₁) ÷ (x₂ − x₁)
x₁, y₁ Coordinates of the first point
x₂, y₂ Coordinates of the second point
Example

For points (1, 2) and (5, 10), rise = 8 and run = 4, so slope = 8 ÷ 4 = 2.

For points (2, 3) and (8, 15), rise = 12 and run = 6, so slope = 12 ÷ 6 = 2. The line equation is y = 2x − 1.

For points (0, 5) and (4, 1), rise = −4 and run = 4, so slope = −4 ÷ 4 = −1. The line equation is y = −x + 5.

Assumptions
  • Both points are on the same straight line being analyzed.
  • If x₂ = x₁, the slope is undefined because the line is vertical.
  • The coordinate plane uses the standard Cartesian system.
Notes
  • Positive slope means the line rises from left to right.
  • Negative slope means the line falls from left to right.
  • Undefined slope means the line is vertical.
Sources
  1. Coordinate geometry and algebra definitions of slope

What is slope?

Slope measures the steepness and direction of a straight line on a coordinate plane. It is defined as the ratio of vertical change (rise) to horizontal change (run) between any two points on the line. A positive slope means the line rises from left to right, a negative slope means it falls, a zero slope means the line is horizontal, and an undefined slope means the line is vertical. The concept is central to algebra, calculus, physics, and engineering. In calculus, slope generalizes to the derivative, which measures instantaneous rate of change. Understanding slope is the first step toward understanding how quantities change relative to each other.

Slope in engineering and data analysis

Slope has direct physical meaning in many fields. In civil engineering, the slope of a road or ramp determines its grade — a slope of 0.06 means the surface rises 6 units for every 100 units of horizontal distance. Building codes specify maximum slopes for wheelchair ramps, drainage pipes, and roof pitches. In data analysis, the slope of a trend line tells you how fast a variable is growing or shrinking. A sales chart with a slope of 500 means revenue increases by 500 units for each time period. Economists use slope to describe marginal cost and marginal revenue. Even in fitness, treadmill incline is just slope expressed as a percentage. Recognizing slope in these contexts makes the abstract formula immediately practical.

Slope calculator FAQs

What does slope measure?

Slope measures how quickly y changes relative to x, or how steep a line is.

Why is a vertical line undefined?

Because its run is zero, and division by zero is undefined.

What do rise and run mean?

Rise is the vertical change between the points, and run is the horizontal change.

Written by Jan Křenek Founder and lead developer
Reviewed by DigitSum Methodology Review Formula verification and QA
Last updated Mar 11, 2026

Use this as an estimate and validate important decisions with a qualified professional.

Inputs stay in the browser unless a future feature explicitly tells you otherwise.