GALAXY OF TOOLS

STUDY SECTOR

Slope Calculator – Slope, Intercept and Line Equation from Two Points

Find the slope, y-intercept and equation of the line through two points, with a graph and every step.

Point A
Point B
Slope (m)3/4 = 0.75m = (y₂ − y₁) ÷ (x₂ − x₁) = (5 − 2) ÷ (5 − 1) = 3 ÷ 4
Slope-intercept form
y = (3/4)x + 5/4
Point-slope form
y − 2 = (3/4)(x − 1)
Standard form
3x − 4y = −5
RisingLine direction
36.8699°Angle with the x-axis
5/4 ≈ 1.25y-intercept (b)
−5/3 ≈ −1.66667x-intercept
5Distance between points
(3, 7/2)Midpoint
A(1, 2)B(5, 5)

Looking for the grade of a roof, ramp or drain in percent or degrees? Use the slope calculator for ramps and drains. Coordinates may have up to 6 decimal places; fractions are exact.

Runs entirely in your browser. Nothing you enter or upload is sent to a server.

A slope calculator that shows the line equation and a graph

This slope calculator takes two points and returns the slope of the line through them, its y-intercept and its equation in slope-intercept, point-slope and standard form, together with the angle, the distance between the points and the midpoint. The slope is calculated as an exact fraction as well as a decimal, so 3/4 does not become 0.75 behind your back.

It is aimed at algebra and coordinate-geometry students, teachers preparing examples, and anyone who needs the equation of a straight line fast. A small graph draws the line and both points.

How to use the Slope Calculator (Two Points, Slope-Intercept)

  1. Enter the x and y coordinates of Point A and Point B. Negative numbers and decimals are fine.
  2. Read the slope m in the result box, as a fraction and a decimal.
  3. Copy the line equation you need: slope-intercept (y = mx + b), point-slope or standard form.
  4. Check the y-intercept, x-intercept, angle, distance and midpoint underneath.
  5. Look at the graph to confirm that the line passes through both points.

Slope Calculator (Two Points, Slope-Intercept) features

Exact fractions

Slope and intercepts are reduced fractions with the decimal value alongside.

Three equation forms

Slope-intercept, point-slope and standard form with integer coefficients.

Special lines

Horizontal lines (slope 0) and vertical lines (slope undefined, x = c) are handled explicitly.

Graph and extras

Angle with the x-axis, distance, midpoint and both intercepts.

The slope formula

The slope is the change in y divided by the change in x, often remembered as “rise over run”: m = (y₂ − y₁) ÷ (x₂ − x₁). It does not matter which point you call A or B as long as you subtract in the same order on top and bottom.

Worked example: through (1, 2) and (5, 5), the rise is 5 − 2 = 3 and the run is 5 − 1 = 4, so m = 3/4 = 0.75. The y-intercept is b = y₁ − m·x₁ = 2 − (3/4)(1) = 5/4, so the line is y = (3/4)x + 5/4.

Equation forms

FormPatternExample
Slope-intercepty = mx + by = (3/4)x + 5/4
Point-slopey − y₁ = m(x − x₁)y − 2 = (3/4)(x − 1)
StandardAx + By = C3x − 4y = −5

Reading the sign and size of the slope

  • Positive slope: the line rises from left to right. Negative slope: it falls.
  • Zero slope: a horizontal line, y = constant.
  • Undefined slope: a vertical line, x = constant, because the run is 0 and division by zero is not allowed.
  • Larger absolute values mean steeper lines; the angle with the x-axis is arctan(m).
  • Parallel lines have equal slopes; perpendicular lines have slopes whose product is −1.

Worked example with negative numbers

Take A(−2, 3) and B(4, −6). The rise is −6 − 3 = −9 and the run is 4 − (−2) = 6, so m = −9/6 = −3/2 = −1.5: the line falls as you move right. The y-intercept is b = 3 − (−3/2)(−2) = 3 − 3 = 0, so the line is y = (−3/2)x and passes through the origin. Swapping the points gives (3 − (−6)) ÷ (−2 − 4) = 9 ÷ −6, the same slope, which is a quick way to check your arithmetic.

Related tools

To plot more than one line use the function grapher, to fit a line to many points use the linear regression calculator, and to solve for where lines meet try the equation solver. For construction grades (percent, degrees, 1:12), see the ramp and drain slope calculator.

Slope Calculator (Two Points, Slope-Intercept) FAQ

What is the slope formula?

m = (y₂ − y₁) ÷ (x₂ − x₁): the difference in y divided by the difference in x between two points on the line.

How do I find the slope-intercept form of a line?

Find m with the slope formula, then b = y₁ − m·x₁, and write y = mx + b. This tool does both steps and shows the result.

What if the two x values are equal?

The line is vertical and its slope is undefined. The equation is x = that value.

What does a slope of 0 mean?

The line is horizontal: y does not change as x changes.

Can I use decimals and negative numbers?

Yes, up to 6 decimal places; the arithmetic is done exactly with whole numbers, so fractions are reduced correctly.

How is this different from a roof or ramp slope calculator?

This one is coordinate geometry. Roof and ramp tools express slope as a percentage, degrees or ratio like 1:12; the angle shown here is arctan(m).

You might also need