Slope Calculator

Find the slope, equation, intercepts, angle, distance, and midpoint of a line from two points, an equation, or a point and slope, with a graph.

Slope, equation, distance, midpoint, and intercepts from two points.

Point 1
Point 2
Try
Graph of the lineLine through points (2, 3) and (6, 11), with slope 2 and equation y = 2x − 1. Rises from left to right. It crosses the y-axis at (0, −1). It crosses the x-axis at (1/2, 0). The dashed rise/run triangle shows a run of 4 and a rise of 8.xy−10−551015−55100run = 4rise = 8(0, −1)(1/2, 0)P₁ (2, 3)P₂ (6, 11)

Slope

m = 2

2/1 · y = 2x − 1

What does this slope mean? For every 1-unit increase in x, y increases by 2 units.

Slope type
Positive
Direction
Rises from left to right
Angle of inclination
63.435°
Equation
y = 2x − 1
Distance
4√5 ≈ 8.944
Midpoint
(4, 7)
y-intercept
(0, −1)
x-intercept
(1/2, 0)
Equation of the line
Slope-intercept formy = 2x − 1
Point-slope formy − 3 = 2(x − 2)
Standard form2x − y = 1

Step-by-step solution

Step 1 — Identify the points

(x₁, y₁) = (2, 3)

(x₂, y₂) = (6, 11)

Step 2 — Calculate the change in y (rise)

Δy = y₂ − y₁ = 11 − 3 = 8

Step 3 — Calculate the change in x (run)

Δx = x₂ − x₁ = 6 − 2 = 4

Step 4 — Calculate the slope

m = Δy / Δx

= 8 / 4

= 2

Step 5 — Interpret the slope

For every 1-unit increase in x, y increases by 2 units.

Step 6 — Write the equation of the line

b = y₁ − m·x₁

= 3 − 2 × 2 = −1

Slope-intercept form: y = 2x − 1

Point-slope form: y − 3 = 2(x − 2)

Standard form: 2x − y = 1

Step 7 — Distance between the points

d = √(Δx² + Δy²)

= √(4² + 8²) = √80

= 4√5 ≈ 8.944

Step 8 — Midpoint

M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2)

= ((2 + 6) / 2, (3 + 11) / 2) = (4, 7)

Step 9 — Angle of inclination

θ = arctan(2) = 63.435°

Slope = tan(θ)

Step 10 — Intercepts

y-intercept: set x = 0 → y = −1, the point (0, −1)

x-intercept: set y = 0 → x = 1/2 = 0.5, the point (1/2, 0)

Coordinates, slopes, and intercepts are calculated as exact fractions; decimals are rounded only for display. Need just one measurement? Use the Distance Formula Calculator or Midpoint Calculator. To find where two lines cross, use the System of Equations Calculator, and for a best-fit line through many points, the Linear Regression Calculator.

This slope calculator analyzes a whole line, not just its steepness. Enter two points, an equation (y = mx + b, Ax + By = C, or y − y₁ = m(x − x₁)), or a point and a slope, and it gives the slope as an exact fraction and a decimal, whether it is positive, negative, zero, or undefined, the angle of inclination, the equation in three forms, the x- and y-intercepts, and, for two points, the distance and midpoint.

The line is drawn to scale on a coordinate graph with the rise/run triangle, and every result comes with step-by-step working. Two extra tools check whether two slopes are parallel or perpendicular and build the parallel and perpendicular lines through a point.

Worked Calculation Examples

ScenarioResultCalculation Step
Points (2, 3) and (6, 11)m = 2, y = 2x − 1Δy = 11 − 3 = 8 and Δx = 6 − 2 = 4, so m = 8/4 = 2. b = 3 − 2 × 2 = −1. Distance √80 = 4√5 ≈ 8.944; midpoint (4, 7).
Points (1, 8) and (5, 2)m = −3/2 = −1.5Δy = 2 − 8 = −6 and Δx = 5 − 1 = 4, so m = −6/4 = −3/2. The line falls 3 units for every 2 units to the right.
Points (4, 2) and (4, 10)Undefined slope, x = 4Δx = 4 − 4 = 0, and division by 0 is undefined, so the line is vertical: x = 4. Its inclination is 90°.
Equation 3x + 4y = 12m = −3/4m = −A/B = −3/4. The intercepts are (4, 0) and (0, 3), and the slope-intercept form is y = −(3/4)x + 3.
Slope 2 through (3, 5): parallel and perpendiculary = 2x − 1 and y = −(1/2)x + 13/2The parallel line keeps m = 2: y − 5 = 2(x − 3). The perpendicular slope is −1/2, since 2 × (−1/2) = −1: y − 5 = −(1/2)(x − 3).

What Is Slope?

Slope measures how steep a line is and which way it goes: the change in y for each 1-unit change in x. It is written m and calculated as rise over run, m = (y₂ − y₁) / (x₂ − x₁).

A positive slope rises from left to right, a negative slope falls, a slope of 0 is a horizontal line, and a vertical line has an undefined slope, because its run is 0 and division by 0 is undefined. A slope of 3/4 means the line rises 3 units for every 4 units to the right; a slope of −2 means it falls 2 units for every 1 unit to the right.

How to Find the Slope From an Equation

In slope-intercept form, y = mx + b, the slope is the coefficient of x and b is the y-intercept: y = 2x − 1 has slope 2. In standard form, Ax + By = C, the slope is −A/B, so 3x + 4y = 12 has slope −3/4. In point-slope form, y − y₁ = m(x − x₁), the slope is m and the line passes through (x₁, y₁). An equation like x = 4 is a vertical line with undefined slope, and y = 5 is a horizontal line with slope 0.

Slope and the Angle of Inclination

The angle of inclination θ is the angle the line makes with the positive x-axis, measured counterclockwise, from 0° up to (but not including) 180°. The slope is its tangent: m = tan θ, so θ = arctan(m). A slope of 1 is a 45° line, and a slope of 2 is about 63.43°. For a negative slope, arctan gives a negative angle, so add 180°: a slope of −1 has an inclination of 135°. A vertical line makes a 90° angle, which matches its undefined slope, since tan 90° is undefined.

Parallel and Perpendicular Lines

Parallel lines have the same slope, like y = 2x + 1 and y = 2x − 5; two vertical lines are also parallel. Perpendicular lines meet at a right angle, and their slopes multiply to −1: 2 and −1/2 are perpendicular because 2 × (−1/2) = −1. To get a perpendicular slope, take the negative reciprocal. A horizontal line (slope 0) and a vertical line (undefined slope) are also perpendicular, even though the product rule cannot be applied to them.

How to Use the Slope Calculator

  1. Choose how you know the line: two points, an equation, a point and a slope, or pick Compare slopes or Parallel & perpendicular.
  2. Enter the values. Coordinates and slopes accept integers, decimals, negatives, and fractions such as 3/4; equations accept forms like y = 2x − 1, 3x + 4y = 12, or y − 5 = 3(x − 2).
  3. Read the slope as a simplified fraction and a decimal, and check its type (positive, negative, zero, or undefined), direction, and angle.
  4. Look at the graph: the line, your points, the rise/run triangle, and the intercepts are drawn to scale and update as you type.
  5. Use the equations, intercepts, distance, and midpoint, and follow the step-by-step solution, which uses your numbers. Copy result copies a summary.

Frequently Asked Questions

How do you find the slope between two points?

Subtract the y-coordinates and divide by the difference of the x-coordinates, in the same order: m = (y₂ − y₁) / (x₂ − x₁). For (2, 3) and (6, 11), m = (11 − 3) / (6 − 2) = 8/4 = 2.

What is the slope formula?

m = (y₂ − y₁) / (x₂ − x₁), the rise (change in y) over the run (change in x) between any two points on the line.

What does a negative slope mean?

The line falls from left to right: y decreases as x increases. A slope of −2 means y drops 2 units for every 1 unit you move to the right.

What is a zero slope?

A slope of 0 means the line is horizontal: y stays the same for every x, as in y = 5. Horizontal lines have a y-intercept but, unless the line is y = 0, no x-intercept.

Why is the slope of a vertical line undefined?

On a vertical line both points have the same x-coordinate, so the run x₂ − x₁ is 0, and dividing by 0 is undefined. The line is written x = constant instead of y = mx + b.

How do you find the equation of a line from two points?

Find the slope m, then substitute one point into y − y₁ = m(x − x₁), or solve b = y₁ − m·x₁ for y = mx + b. For (2, 3) and (6, 11), m = 2 and b = 3 − 4 = −1, so y = 2x − 1.

How do you find the slope from an equation?

In y = mx + b, the slope is the number multiplying x. In Ax + By = C, it is −A/B. In y − y₁ = m(x − x₁), it is m.

How do you find the x- and y-intercepts?

For the y-intercept, set x = 0 and solve for y; for the x-intercept, set y = 0 and solve for x. For y = 2x − 4, the y-intercept is (0, −4) and the x-intercept is (2, 0).

How is slope related to angle?

The slope is the tangent of the angle of inclination: m = tan θ, so θ = arctan(m). A slope of 1 is a 45° line.

How do you know if two lines are parallel or perpendicular?

Parallel lines have equal slopes. Perpendicular lines have slopes whose product is −1, like 3 and −1/3. A horizontal and a vertical line are also perpendicular.

Last updated: September 27, 2026.