Slope Calculator — Gradient & Line

Calculate the slope of a line between two points and find the line equation.

Calculate slope and line equation from two points

What Is the Slope Calculator — Gradient & Line?

The Slope Calculator finds the gradient (steepness) of the line passing through two points and expresses it as the line equation in slope-intercept form y = mx + b. Slope is defined as the ratio of vertical change (rise) to horizontal change (run) between any two points on a line.

Formula

Slope (gradient): m = (y₂ − y₁) / (x₂ − x₁) = Δy / Δx Slope-intercept form: y = mx + b where b = y₁ − m·x₁ Angle with x-axis: θ = arctan(m) (in degrees) Parallel lines share slope m; perpendicular lines have slopes m and −1/m

How to Use

Enter the coordinates of two points: (x₁, y₁) and (x₂, y₂). Click Calculate to get the slope, y-intercept, full line equation, and the angle the line makes with the x-axis. If the line is vertical (x₁ = x₂), the slope is undefined.

Example Calculation

Points: (1, 3) and (5, 11) m = (11 − 3) / (5 − 1) = 8/4 = 2 b = 3 − 2×1 = 1 Line: y = 2x + 1 Angle: arctan(2) ≈ 63.43° Check: at x=5, y = 2(5)+1 = 11 ✓

Understanding Slope — Gradient & Line

Slope is one of the central concepts in mathematics, representing the rate of change of one quantity with respect to another. In calculus, the derivative at a point is the instantaneous slope of the tangent line to a curve — so mastering slope is the foundation of differential calculus.

In real-world applications, slope appears constantly: road gradients (a 5% slope means 5 m rise per 100 m run), roof pitches (rise:run ratios), ramp accessibility standards (ADA requires ≤ 1:12 slope), stock price trends (rise per time period), and physics (velocity as the slope of position vs. time).

The concept of slope extends to multivariate calculus as the gradient vector, which points in the direction of steepest ascent of a multivariable function.

Frequently Asked Questions

What does a positive vs. negative slope mean?

A positive slope (m > 0) means the line rises from left to right. A negative slope (m < 0) means it falls. m = 0 is a horizontal line; undefined slope is a vertical line.

What is slope-intercept form?

y = mx + b is slope-intercept form, where m is the slope and b is the y-intercept (where the line crosses the y-axis). It is the most common way to express a line equation.

What is the slope of a horizontal line?

A horizontal line has slope m = 0, since the y-values do not change (Δy = 0) as x varies.

When is slope undefined?

Slope is undefined for vertical lines (x₁ = x₂), because division by zero (Δx = 0) is not defined. These lines have the equation x = constant.

How are perpendicular slopes related?

Two lines are perpendicular if and only if the product of their slopes is −1 (m₁ × m₂ = −1), i.e., their slopes are negative reciprocals.

Related Tools