RAPIDCALC • WORLDWIDE TOOLS

Slope Calculator

Find slope, angle and linear equation from two points.

Calculation inputs

Calculation results

Slope2
Angle63.43495°
Y-intercept0
Equationy = 2x + 0
Change in x4
Change in y8
Formula

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

Results update instantly. Check units, assumptions and input values before using any estimate.

CALCULATOR GUIDE

Understand Slope Calculator

Explore the formula, worked examples and practical explanations behind this calculator.

What Is a Slope Calculator?

Find a line’s slope from any two distinct points. Review the rise over run, angle with the horizontal and slope-intercept equation.

How to Use This Calculator

Choose the calculator inputs shown above, enter valid numbers and review the result card. Find slope, intercept, direction and line equation from coordinate points. Results update as inputs change, so compare several realistic examples rather than relying on a single result.

Calculation Formula

m = (y₂ − y₁) / (x₂ − x₁), provided x₂ ≠ x₁.

Worked Example

Between (1,2) and (5,10), slope m = (10−2)/(5−1) = 2 and the line is y = 2x.

What Does Slope Mean?

Slope measures the vertical change in y divided by the horizontal change in x. Positive slope means a line rises left to right; negative slope means it falls. A horizontal line has slope zero.

Two-Point Slope Formula

For points (x₁,y₁) and (x₂,y₂), compute m = (y₂−y₁)/(x₂−x₁). The denominator must not be zero. Enter numeric coordinates for both points.

Worked Coordinate Example

Take (1,2) and (5,10). The rise is 8, the run is 4, and m is 2. Substituting point (1,2) into y = mx + b gives 2 = 2 + b so b = 0.

Y-Intercept and Line Equation

After finding m, calculate b = y₁ − m × x₁. The resulting equation is y = mx + b. The output rounds displayed coefficients, so retain more digits in accuracy-sensitive work.

Slope Angle

The angle with the positive x-axis in this tool is arctan(m), converted into degrees. It is a principal angle between −90° and +90°. For direction-sensitive bearings, additional conventions may be required.

Vertical and Horizontal Lines

When x₂ = x₁, the line is vertical and slope is undefined; its equation is x = constant. When y₂ = y₁, the line is horizontal with slope zero, and y is constant.

Common Mistakes and Limitations

Confirm the coordinate order and use the same subtraction direction for x and y. Identical x-coordinates create an undefined slope, while rounded display values may only approximate the original line.

Slope Formula: Worked Coordinate Examples

For two points (x₁, y₁) and (x₂, y₂), calculate m = (y₂ − y₁)/(x₂ − x₁). The numerator is the vertical change or rise, and the denominator is the horizontal change or run. The order must stay consistent: if you subtract y₁ from y₂, also subtract x₁ from x₂.

Positive slope

Points (1, 2) and (5, 10) give (10 − 2)/(5 − 1) = 8/4 = 2. For each one-unit increase in x, y rises by two units.

Negative slope

Points (−2, 5) and (4, −1) give (−1 − 5)/(4 − (−2)) = −6/6 = −1. The line falls as x increases.

Horizontal and vertical lines

Points (1, 4) and (9, 4) give zero rise, so the slope is 0. Points (3, −2) and (3, 7) have zero run, so the slope is undefined, not infinity or zero. A vertical line is written x = 3, rather than y = mx + b.

From Slope to the Line Equation

For a nonvertical line, the slope-intercept equation is y = mx + b. Once m is known, substitute a point to calculate b = y₁ − mx₁. For example, with slope 2 and point (1, 2), b = 2 − 2 × 1 = 0, so the line is y = 2x.

Another example: slope −1 and point (−2, 5) give b = 5 − (−1 × −2) = 3, so the equation is y = −x + 3. You can verify any equation by substituting both original points.

Angle of Inclination

A line’s slope relates to its angle through tan(θ) = m. The arctangent function returns an angle corresponding to the slope; a negative slope yields a negative principal arctangent, while the conventional counterclockwise inclination of a nonvertical line may instead be expressed between 0° and 180° by adding 180° to a negative angle. Always check the angle convention used by the result display.

For m = 1, the line makes a 45° angle above the positive horizontal direction; m = 0 corresponds to a horizontal line. The angle is not a substitute for the slope when axes use different physical scales.

Common Uses of Slope

In coordinate geometry, slope describes the rate at which y changes with x. It can represent distance over time on a position-time chart, a simplified cost increase per additional item, or the grade of a straight ramp. For physical ramps, distinguish the dimensionless rise/run ratio from percentage grade = 100 × rise/run. A slope of 0.1 is a 10% grade, not a 10° angle.

This two-point tool assumes a straight line and does not calculate regression slope from a large, noisy dataset. If your data have many points or measurement uncertainty, consider statistical linear regression instead.

Checking Your Coordinates

A common mistake is to reverse only one subtraction: (y₂ − y₁)/(x₁ − x₂) changes the sign. Another is confusing ordered pairs (x, y) with (y, x). If x₁ = x₂, avoid dividing by zero and identify the vertical line explicitly. When rounding results, remember that the displayed equation may be approximate for nonterminating decimals.

COMMON QUESTIONS

Frequently Asked Questions

Clear answers to help you understand your results.

01What is the slope formula?
Slope equals change in y divided by change in x.
02What if x1 equals x2?
The line is vertical and the slope is undefined.
03Can slope be negative?
Yes, when y decreases as x increases.
04Is a horizontal line slope zero?
Yes, if the x-values differ and the y-values are equal.
05How do I find the y-intercept?
Calculate b = y1 − m × x1.
06Can I use decimals or negative coordinates?
Yes.
07Does the calculator display an angle?
Yes, arctan(slope) expressed in degrees.
08Are the equation numbers exact?
Results are calculated from inputs, but displayed values may be rounded.