Slope Calculator – Slope of a Line Between Two Points

Calculate slope (gradient), angle, and equation of a line from two coordinate points.

About This Calculator

Calculate slope (gradient), angle, and equation of a line from two coordinate points. Use the calculator above for instant results.

Understanding Slope

Slope measures the rate of vertical change relative to horizontal change between two points. For (x₁,y₁) and (x₂,y₂), the slope is m=(y₂-y₁)/(x₂-x₁). A positive slope rises from left to right, a negative slope falls, and zero slope describes a horizontal line.

When x₂=x₁, the horizontal change is zero and division by zero is undefined, so the line is vertical and has no finite slope. Once m is known, the y-intercept can be found from b=y₁-mx₁, giving slope-intercept form y=mx+b. The inclination angle relative to the positive x-axis is related by tan θ=m, with quadrant conventions considered separately when direction matters.

Worked Examples

Example 1: (2,3) to (6,7)

  • m = (7-3)/(6-2) = 4/4 = 1 | y = x + 1

Answer: Slope = 1

Example 2: (0,0) to (4,2)

  • m = 2/4 = 0.5 | y = 0.5x

Answer: Slope = 0.5

Example 3: (1,5) to (4,2)

  • m = (2-5)/(4-1) = -1 | y = -x + 6 (negative slope — going down)

Answer: Slope = -1

Example 4: Points (1,2) and (4,11)
  • m=(11-2)/(4-1)=9/3=3.
  • b=2-3(1)=-1.

Answer: y=3x-1

Example 5: Horizontal line through (2,5) and (8,5)
  • m=(5-5)/(8-2)=0.

Answer: slope = 0

Who Uses This Calculator?

📐
Math Students

Graphing and linear equations.

📊
Data Analysts

Calculate trend line slopes.

🏫
Teachers

Visualize slope concept.

🗺️
Surveyors

Grade and incline calculations.

Common Mistakes to Avoid

❌ Confusing rise over run

Slope = rise/run = (y₂-y₁)/(x₂-x₁). Rise is vertical change, run is horizontal change.

❌ Undefined vs zero slope

Undefined: vertical line (x₂=x₁). Zero slope: horizontal line (y₂=y₁). These are opposites.

❌ Reversing only one difference

If you compute y₁-y₂, you must also compute x₁-x₂. Reversing both leaves the same slope; reversing only one changes its sign.

❌ Calling a vertical line slope zero

Horizontal lines have slope 0. Vertical lines have undefined slope because Δx=0.

How to Interpret and Check Slope

A slope should match the visual direction from the first point to the second. If x increases and y also increases, the slope must be positive; if x increases while y decreases, it must be negative. If y does not change, m=0. If x does not change, the line is vertical and the slope is undefined.

After computing m, substitute either point into y=mx+b to find b, then substitute the other point into the completed equation. Both points must satisfy the same line. This catches sign errors in the difference calculation and mistakes when finding the intercept. For example, a line through (1,2) and (4,11) has m=3 and b=-1; checking x=4 gives 3(4)-1=11.

Slope has units when x and y represent measured quantities. If y is kilometers and x is hours, the slope has units of kilometers per hour. Interpreting those units often makes the mathematical result more meaningful than the decimal value alone.

For rate-of-change problems, distinguish slope from total change. A slope of 3 does not mean y changed by 3 unless x changed by exactly 1. Over a horizontal change Δx, the corresponding line change is Δy=mΔx. This relationship is a quick way to predict another point and verify that the computed equation behaves consistently.

Frequently Asked Questions

What does slope mean?

Rate of change. A slope of 2 means for every 1 unit right, y increases by 2 units.

Positive vs negative slope?

Positive: line goes up left to right. Negative: line goes down. Zero: horizontal. Undefined: vertical.

Slope-intercept form?

y = mx + b. Where m is slope and b is the y-intercept (where line crosses y-axis).

What does slope 2 mean?

For every one-unit increase in x, y increases by 2 units along that line.

Can slope be negative?

Yes. A negative slope means y decreases as x increases.

Why is vertical slope undefined?

The slope denominator Δx equals zero, and division by zero is undefined.

How is slope related to angle?

For a nonvertical line, m=tan θ for an appropriate angle θ measured from the positive x-axis.

Formula Explorer connections

Interpretation: This relationship connects dimensions, coordinates, angles or trigonometric ratios to a geometric measurement. Assumption: Use a consistent angle mode and length unit, identify the intended shape or coordinate system, and verify that the supplied dimensions form valid geometry.

Surface Area Calculator – 3D Shape Surface Area →Triangle Calculator – Area, Angles, and Sides →Trigonometric Functions Calculator →Math Formula Explorer →