Algebra • Core Pillar

Slope Calculator

Calculate the slope (m = Δy / Δx) of a straight line from two coordinates or point-slope parameters, derive full linear equations (y = mx + b), determine angle of inclination, and visualize rise-and-run right triangles on a dynamic Cartesian graph.

|
Last Updated: September 2026
|
Cartesian Coordinate Proofs

Coordinate Points

m = Δy / Δx
Point 1 (P₁)
Point 2 (P₂)
Example Point Pairs:

Slope & Line Equation

Positive Slope (m > 0)
Calculated Slope (m = Δy / Δx)
m = 2
y = 2x
Angle (θ) 63.43°
Y-Intercept (b) (0, 0)
Distance (d) 6.708
Midpoint (M) (2.5, 5)
Point-Slope Form y − 2 = 2(x − 1)
Standard Form 2x − y = 0
Perpendicular Slope (m⊥) -0.5 (-1/2)

Interactive Cartesian Line & Slope Triangle Plot

Line Points Δy / Δx

Step-by-Step Slope Derivation

Direct Answer & Overview
Verified Educational Guide

How to Calculate the Slope of a Line

The slope (m) of a line measures its steepness and direction. Given two coordinate points (x₁, y₁) and (x₂, y₂), the slope is calculated by dividing the vertical difference (rise, y₂ − y₁) by the horizontal difference (run, x₂ − x₁). If x₁ = x₂, the slope is undefined (vertical line); if y₁ = y₂, the slope is zero (horizontal line).

Primary Mathematical Formula Standard Mathematical Model
Standard Equation
ƒ(x)
Q.E.D.
m = rac{ ext{Rise}}{ ext{Run}} = rac{Delta y}{Delta x} = rac{y_2 - y_1}{x_2 - x_1} quad | quad y = mx + b
Evaluated with exact mathematical formulation • Rigorously verified
Exact Formula
Input Parameters
Required
1
Point 1 Coordinates (x₁, y₁)
2
Point 2 Coordinates (x₂, y₂)
Expected Outputs
Calculated
Exact and Decimal Slope (m)
Slope-Intercept Equation (y = mx + b) and Y-Intercept (0, b)
Point-Slope Form and Standard Form (Ax + By = C)
Angle of Inclination θ, Distance d, and Perpendicular Slope
Worked Numerical Example
Instant Verification
Find the slope between P₁(1, 2) and P₂(4, 8)
→ Δy = 8 - 2 = 6. Δx = 4 - 1 = 3. m = 6 / 3 = 2. Y-intercept b = 2 - 2(1) = 0
m = 2, y = 2x

Anatomy of Slope (m = Rise / Run = Δy / Δx)

In analytic geometry, slope (often denoted by m from the French word monter, to climb) describes the rate of vertical elevation change relative to horizontal displacement:

Vertical Change (Δy • Rise)
Δy = y₂ − y₁

Measures the altitude gain (positive) or drop (negative) between the two coordinates.

Horizontal Change (Δx • Run)
Δx = x₂ − x₁

Measures the lateral span traveled across the horizontal x-axis from left to right.

The Four Types of Slope (Positive, Negative, Zero, Undefined)

Every straight line in a two-dimensional Cartesian plane belongs to one of four fundamental geometric slope categories:

Positive (m > 0)
Rises Left to Right

As x increases, y increases proportionally.

Negative (m < 0)
Falls Left to Right

As x increases, y decreases steadily.

Zero (m = 0)
Horizontal Flat Line

y is constant: y = b. No vertical rise.

Undefined
Vertical Line (x = c)

Δx = 0; division by zero is undefined.

Three Core Forms of Linear Equations

Algebraists represent straight lines in three mathematically equivalent coordinate forms:

1. Slope-Intercept Form y = mx + b

The standard form where m is the slope and b is the y-intercept (0, b).

2. Point-Slope Form y − y₁ = m(x − x₁)

Ideal for writing the equation when you know the gradient m and any single coordinate point (x₁, y₁).

3. Standard (General) Form Ax + By = C

Where A, B, C are integers, A ≥ 0, and gcd(A, B, C) = 1.

Parallel vs. Perpendicular Lines

The geometric relationship between two lines is governed by their respective slope values:

Parallel Lines (m₁ = m₂)
m₁ = m₂ & b₁ ≠ b₂

Parallel lines never intersect because they ascend or descend at the identical gradient rate.

Perpendicular Lines (m₁ × m₂ = −1)
m₂ = −1 / m₁

Perpendicular lines intersect at a right angle (90°). Their slopes are negative reciprocals.

Angle of Inclination (θ = arctan(m)) & Grade %

Slope translates directly into trigonometry and engineering incline units:

Angle of Inclination (θ)

The angle formed between the positive horizontal axis and the line:

θ = arctan(m)   (in degrees or radians)

Road Grade & Roof Pitch

Civil highway gradient percentage and architectural roof pitch:

Grade % = (Rise / Run) × 100 = m × 100

Real-World Applications (Civil Engineering, Economics, Kinematics)

Slope is the mathematical foundation for rates of change across all applied sciences:

Civil Highway & ADA Ramp Incline

Building accessibility codes mandate ADA wheelchair ramps have a maximum slope of 1:12 (8.33% grade) to ensure safety.

Physics: Velocity & Acceleration

On a position-time graph, the slope represents velocity (v = Δx / Δt). On a velocity-time graph, slope represents acceleration.

Economics: Marginal Cost & Elasticity

The slope of total cost curves gives marginal cost (MC = ΔC / ΔQ), dictating pricing equilibrium in supply-demand curves.

Hydrology & Drainage Runoff

Landscape architects calculate ground slopes (minimum 2% grade away from foundations) to ensure rainwater drainage prevents structural water intrusion.

Step-by-Step Worked Examples

Example 1: Slope between P₁(1, 2) and P₂(4, 8) Positive Slope

1. Compute Rise: Δy = y₂ − y₁ = 8 − 2 = 6.

2. Compute Run: Δx = x₂ − x₁ = 4 − 1 = 3.

3. Divide: m = 6 / 3 = 2.

4. Y-intercept: b = y₁ − m(x₁) = 2 − 2(1) = 0.

5. Linear Equation: y = 2x.

Common Calculation Pitfalls & Orientation Errors

Inverting Run over Rise

Writing Δx / Δy instead of Δy / Δx produces the reciprocal slope. Rise (y) is always the numerator.

Inconsistent Coordinate Order

Calculating (y₂ − y₁) / (x₁ − x₂) flips the sign of the slope. Points must be subtracted in identical order.

Confusing Zero vs. Undefined

Horizontal lines have m = 0. Vertical lines have m = Undefined (never zero).

Fact-Checked & Verified • Computational Accuracy Standards
Updated July 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

What is the slope of a line and what is the formula?
The slope (m) of a line is the ratio of vertical change (rise, Δy) to horizontal change (run, Δx) between any two distinct points on the line: m = (y₂ − y₁) / (x₂ − x₁). It measures both the steepness and direction of the straight line on a Cartesian coordinate plane.
What is the difference between a zero slope and an undefined slope?
A horizontal line has a zero slope (m = 0) because there is no vertical change (Δy = 0, e.g. 0 / 5 = 0). A vertical line has an undefined slope because there is no horizontal change (Δx = 0), resulting in division by zero (e.g. 5 / 0 = undefined), which is mathematically indeterminate.
How do you find the equation of a line using slope and one point (Point-Slope Form)?
Using the point-slope formula y − y₁ = m(x − x₁), substitute the known slope m and the point coordinates (x₁, y₁). For example, with m = 3 and point (2, 5): y − 5 = 3(x − 2) → y − 5 = 3x − 6 → y = 3x − 1 (Slope-Intercept Form).
How do you determine if two lines are parallel or perpendicular?
Two non-vertical lines are parallel if and only if they share the exact same slope (m₁ = m₂). Two lines are perpendicular if their slopes are negative reciprocals of each other: m₁ · m₂ = −1, or m₂ = −1 / m₁ (for example, slopes of 2 and −1/2).
How do you calculate the angle of inclination of a line?
The angle of inclination θ (the counter-clockwise angle between the positive x-axis and the line) is computed using the arctangent function: θ = arctan(m). For instance, a line with slope m = 1 has an angle of inclination θ = arctan(1) = 45° (or π/4 radians).
How is slope converted into a percentage grade (such as road or roof pitch)?
Slope percentage (grade) is calculated by multiplying the decimal slope by 100: Grade % = m × 100 = (Rise / Run) × 100. A road that rises 6 feet over a horizontal distance of 100 feet has a 6% grade (m = 0.06).

Connected Algebra & Geometry Tools

Ecosystem Hub