Skip to main content
HSCalculadora

Slope-Intercept Form Calculator

Find the line equation through two points.

Results update as you type.

Slope (m)
—
y-intercept (b)—
Equation—

How it works

Slope-intercept form, y equals mx plus b, is the most common way to write a line's equation, and this calculator derives it from two points. You enter the coordinates of two points, and it returns the slope, the y-intercept, and the full equation. The slope m measures how steep the line is, calculated as the change in y divided by the change in x between the points, often described as rise over run. A positive slope rises left to right, a negative slope falls, and a slope of zero is horizontal. Once the slope is known, the y-intercept b, the point where the line crosses the y-axis, is found by substituting one of the points into the equation and solving. The result is a complete equation you can graph, use to find other points, or compare with other lines. Slope-intercept form is fundamental in algebra and appears constantly in science, economics, and data analysis, where lines model relationships between variables and the slope represents a rate of change. This calculator requires the two x-coordinates to differ; if they are the same, the line is vertical, which has an undefined slope and cannot be written in slope-intercept form. Enter two points to find the slope, intercept, and equation of the line.

Formula

m = (y₂ − y₁) / (x₂ − x₁) ; b = y₁ − m·x₁

The slope m is the change in y divided by the change in x between the two points, the line's rise over run. Once you know the slope, the y-intercept b comes from rearranging y = mx + b using either point. Together they give the equation of the line in slope-intercept form.

Source:Coordinate geometry

We review all our tools from time to time to ensure accuracy.

Worked example

Point 1 — x₁:0Point 1 — y₁:1Point 2 — x₂:2Point 2 — y₂:5
Slope = (5−1)/(2−0) = 2; intercept = 1; equation y = 2x + 1.

How to use this calculator

  1. 1

    Enter your values

    Enter point 1 — x₁, point 1 — y₁, point 2 — x₂ and point 2 — y₂.

  2. 2

    Adjust the options

    Fine-tune any options to match your situation.

  3. 3

    Read your result

    Slope (m) updates instantly as you type — no button to press.

Frequently asked questions

What is slope-intercept form?

Slope-intercept form is the equation of a line written as y equals mx plus b, where m is the slope and b is the y-intercept. It is popular because it directly shows the line's steepness and where it crosses the y-axis, making it easy to graph and interpret. This calculator produces it from any two points on the line.

How do you find the slope from two points?

The slope equals the difference in the y-coordinates divided by the difference in the x-coordinates, or rise over run. Subtract the first y from the second, subtract the first x from the second, and divide. A larger absolute value means a steeper line, a positive value rises, and a negative value falls from left to right.

How is the y-intercept determined?

After finding the slope, substitute the coordinates of one point into y equals mx plus b and solve for b. The y-intercept is where the line crosses the y-axis, the value of y when x is zero. The calculator does this automatically using one of your points, giving the exact intercept that fits the line.

Why can't a vertical line use this form?

A vertical line has the same x-coordinate for every point, so the change in x is zero, and dividing by zero to find the slope is undefined. Because slope-intercept form requires a defined slope, a vertical line cannot be written as y equals mx plus b; it is written as x equals a constant instead. The calculator returns no result for vertical lines.

What does the slope represent in real problems?

In applied contexts, the slope is a rate of change: how much the output changes per unit change in the input. For example, on a distance-time graph the slope is speed, and on a cost graph it is the price per unit. Interpreting the slope this way turns a line's equation into meaningful information about a relationship.