Home Financial Health Math Conversions Blog All Calculators Other

Slope Calculator

Calculate the slope of a line using two points.

Understanding Slope Calculator

The Slope Calculator determines the slope of a straight line from two points on a coordinate plane. Slope describes the rate at which the y-coordinate changes relative to the x-coordinate and indicates the direction and steepness of a linear relationship.

Enter the x- and y-coordinates of two different points. The calculator determines the slope, change in x and y, direction of the line, angle of inclination, y-intercept, and equation of the line.

How to work through the calculation

Slope Calculator is intended to show the mathematical relationship behind the answer, not just return a number. Enter the quantities requested by the selected method—such as Point 1 - X₁, Point 1 - Y₁, Point 2 - X₂, Point 2 - Y₂—and keep their units or mathematical meaning consistent. Where this calculator offers different shapes, methods, or forms, choose the one that matches the problem before entering the values.

What this calculation can and cannot tell you

For a useful check, look at the units and the scale of the answer before accepting it. A formula can be evaluated correctly while an input is still inappropriate for the problem. Repeating the calculation with a simple test value or checking the result against the expected direction of change can help identify an input mistake.

Slope Calculator

The Slope Calculator determines the slope of a straight line from two points on a coordinate plane. Slope describes the rate at which the y-coordinate changes relative to the x-coordinate and indicates the direction and steepness of a linear relationship.

Enter the x- and y-coordinates of two different points. The calculator determines the slope, change in x and y, direction of the line, angle of inclination, y-intercept, and equation of the line.

Slope Formula

For two points (x₁, y₁) and (x₂, y₂), the slope is calculated by dividing the change in y by the change in x.

m = (y₂ - y₁) / (x₂ - x₁)

The symbol m represents the slope. The numerator represents the vertical change, commonly called rise, while the denominator represents the horizontal change, commonly called run.

Slope = Rise / Run

Understanding Positive and Negative Slope

The sign of the slope describes the direction of the line when moving from left to right.

Positive slope: The line rises from left to right.

Negative slope: The line falls from left to right.

Zero slope: The line is horizontal.

Undefined slope: The line is vertical.

Horizontal Lines

A horizontal line has the same y-coordinate at every point. Therefore, the change in y is zero and the slope is zero.

m = 0 / (x₂ - x₁) = 0

A horizontal line can be written in the form y = b, where b is its constant y-coordinate.

Vertical Lines

A vertical line has the same x-coordinate at every point. Therefore, the change in x is zero. Because division by zero is undefined, a vertical line has an undefined slope rather than a numerical slope.

x₂ - x₁ = 0

m = Δy / 0 = Undefined

A vertical line is represented by an equation of the form x = a, where a is its constant x-coordinate.

Angle of Inclination

The slope is related to the angle that a line makes with the positive x-axis. For a nonvertical line, the relationship is:

m = tan(θ)

Therefore, the angle of inclination can be found using:

θ = arctan(m)

The calculator expresses the angle in degrees.

Slope-Intercept Form

A straight line is commonly written in slope-intercept form as:

y = mx + b

In this equation, m is the slope and b is the y-intercept, which is the point where the line crosses the y-axis.

Once the slope is known, the y-intercept can be calculated from either of the two points using:

b = y - mx

Example

Suppose two points are (1, 2) and (4, 8).

m = (8 - 2) / (4 - 1)

m = 6 / 3

m = 2

The slope is 2. This means that for every 1-unit increase in x, y increases by 2 units.

Using the slope-intercept form, the equation of this line is:

y = 2x

Parallel and Perpendicular Lines

Slope can also be used to compare two nonvertical lines. Parallel lines have equal slopes. Perpendicular lines have slopes whose product is -1, meaning their slopes are negative reciprocals of each other.

Parallel: m₁ = m₂

Perpendicular: m₁ × m₂ = -1

How to Use the Calculator

Enter the x- and y-coordinates for the first point and the x- and y-coordinates for the second point. The calculator will determine the slope and provide the changes in x and y used in the calculation.

For a nonvertical line, the result also includes the line's direction, angle of inclination, y-intercept, and equation in slope-intercept form. If the two points form a vertical line, the calculator identifies the slope as undefined and provides the corresponding vertical-line equation.

Disclaimer

This calculator is intended for informational purposes only. While we strive for accuracy, we cannot guarantee that every result is correct for every situation.