Slope

Slope between two points and line equation.

Slope (m)
2
63.43°
Angle
y = 2x + 0
Equation

How to Use the Slope Calculator

  1. Enter the x-coordinate and y-coordinate of your first point (x₁, y₁) into the corresponding input fields.
  2. Enter the x-coordinate and y-coordinate of your second point (x₂, y₂) into the second pair of fields.
  3. Click 'Calculate' to instantly compute the slope.
  4. Read the result — the slope m is shown as a decimal. If the line is vertical (x₁ = x₂), the slope is undefined.
  5. Optionally review the step-by-step breakdown to see the rise, run, and final division shown explicitly.

Slope Formula

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

The slope m of a line passing through two points is defined as the rise (vertical change) divided by the run (horizontal change). This ratio tells you how steeply the line ascends or descends from left to right. A positive slope means the line rises, a negative slope means it falls, a slope of zero means the line is horizontal, and an undefined slope means the line is vertical.

  • m — The slope of the line — a number representing the steepness and direction of the line.
  • y₂ — The y-coordinate of the second point on the line.
  • y₁ — The y-coordinate of the first point on the line.
  • x₂ — The x-coordinate of the second point on the line.
  • x₁ — The x-coordinate of the first point on the line.
  • (y₂ − y₁) — The 'rise' — the vertical distance between the two points.
  • (x₂ − x₁) — The 'run' — the horizontal distance between the two points.

Worked Example: Slope Between Two Points

Point 1: (2, 3) and Point 2: (6, 11)
m = (y₂ − y₁) / (x₂ − x₁) = (11 − 3) / (6 − 2) = 8 / 4 = 2

Result: The slope m = 2

What Your Result Means

A slope of 2 means the line rises 2 units vertically for every 1 unit it moves horizontally to the right. Because the slope is positive, the line goes upward from left to right. In practical terms, if you were walking along this line, you would climb 2 feet for every 1 foot of forward travel.

Understanding Slope

Understanding Slope

Slope is one of the most fundamental concepts in algebra and coordinate geometry. It quantifies how a line changes — how steeply it rises or falls — as you move from left to right along the x-axis.

Types of Slope

  • Positive slope (m > 0): The line rises from left to right (e.g., m = 3).
  • Negative slope (m < 0): The line falls from left to right (e.g., m = −2).
  • Zero slope (m = 0): The line is perfectly horizontal (e.g., y = 4).
  • Undefined slope: The line is perfectly vertical (x₁ = x₂); division by zero is impossible.

Slope in the Real World

Slope isn't just a classroom concept. Engineers use slope to design roads and ramps (grade percentage), architects use it for roof pitch, physicists use it as the rate of change in distance-time graphs, and economists use it to represent marginal cost or revenue in linear models.

Slope-Intercept Form

Once you know the slope, you can write the equation of a line in slope-intercept form: y = mx + b, where m is the slope and b is the y-intercept (where the line crosses the y-axis).

Percent Grade

Slope is often expressed as a percentage grade in construction and road engineering: Grade (%) = m × 100. A slope of 0.05 corresponds to a 5% grade — common on highway on-ramps.

Common Mistakes

  • **Reversing the subtraction order:** Always subtract in the same order for both coordinates — (y₂ − y₁) / (x₂ − x₁). Mixing orders (e.g., y₂ − y₁ in the numerator but x₁ − x₂ in the denominator) flips the sign of the slope.
  • **Confusing x and y values:** Make sure you enter the horizontal coordinate in the x field and the vertical coordinate in the y field. Swapping them gives a completely different — and wrong — slope.
  • **Dividing by zero:** If the two x-coordinates are identical, the line is vertical and the slope is undefined, not zero. Zero slope belongs to a horizontal line.
  • **Using three or more points without checking collinearity:** The slope formula only applies between exactly two points. If your points aren't on the same straight line, you'll get a different slope for each pair.
  • **Forgetting the sign:** A negative slope is meaningful — it indicates a decreasing line. Don't drop the negative sign when recording your answer.

Common Questions About Slope

How do I find the y-intercept after calculating the slope?

Use the slope-intercept formula: b = y − mx. Plug in the slope m and the coordinates of either known point (x, y) to solve for b. Then write the full line equation as y = mx + b.

How is slope related to the angle of a line?

The slope equals the tangent of the angle θ that the line makes with the positive x-axis: m = tan(θ). To find the angle, calculate θ = arctan(m). For example, a slope of 1 corresponds to a 45° angle.

What is a 'percent grade' and how does it relate to slope?

Percent grade expresses slope as a percentage: Grade (%) = (rise / run) × 100 = m × 100. A road with a 6% grade rises 6 feet for every 100 feet of horizontal travel, which corresponds to a slope of 0.06.

How do I calculate slope from an equation rather than two points?

If the equation is in slope-intercept form (y = mx + b), the slope is simply the coefficient m. If it's in standard form (Ax + By = C), rearrange to slope-intercept form: y = (−A/B)x + (C/B), so the slope is −A/B.

Frequently Asked Questions

What is slope in math?

Slope (m) is a number that describes the steepness and direction of a straight line. It equals the ratio of the vertical change (rise) to the horizontal change (run) between any two points on the line: m = (y₂ − y₁) / (x₂ − x₁).

What does it mean if the slope is undefined?

An undefined slope occurs when the two points have the same x-coordinate, making the denominator (x₂ − x₁) equal to zero. Division by zero is undefined in mathematics, and geometrically it means the line is perfectly vertical.

Can slope be a fraction?

Yes. Slope is often a fraction. For example, points (1, 2) and (4, 5) give a slope of 3/3 = 1, while points (0, 1) and (4, 3) give a slope of 2/4 = 1/2. The calculator can display both decimal and simplified fraction forms.

Does the order of the two points matter?

No — as long as you are consistent. If you call a point (x₁, y₁), you must use the same point's y-value in the numerator. Swapping which point is 'first' and 'second' changes the signs of both numerator and denominator, so they cancel and the slope remains the same.

What is the difference between slope and gradient?

They mean the same thing in most contexts. 'Slope' is the term used most in algebra and American mathematics education, while 'gradient' is more common in British English, physics, and calculus (where it can also refer to a vector in multiple dimensions).

Related Calculators

Sources

Only sources that have been reviewed are shown. Unverified citations are never published.

Spotted a calculation error?Report an Error
How this calculator works:MethodologyReport an Error

Report an issue or suggest a feature

Spotted an inaccuracy or have an idea to improve this calculator? Let us know.

We use cookies to operate the site, and — with your consent — to show advertising and measure usage. You can change your choice anytime in Cookie Settings.

Manage options