Skip to main content
HSCalculadora

Slope Calculator

Find the slope of a line through two points.

Results update as you type.

Slope (m)
—
y-intercept (b)—
Line equation—

How it works

The slope of a line measures how steeply it rises or falls, defined as the change in y divided by the change in x between any two points on the line. It is one of the most fundamental ideas in coordinate geometry and algebra, because it captures both the direction of a line and how fast it climbs. This slope calculator takes two points and returns the slope, the y-intercept, and the full equation of the line in slope-intercept form, y equals mx plus b. A positive slope means the line goes up from left to right, a negative slope means it goes down, a slope of zero is a flat horizontal line, and a vertical line has an undefined slope because its run is zero. For the points (0, 0) and (2, 4), the slope is 4 divided by 2, which is 2, and the line passes through the origin so its equation is y equals 2x. Students learning linear equations, analysts reading trends, and anyone working with rates of change use a slope calculator to turn two coordinates into a clear description of the line joining them without redrawing a graph.

Formula

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

Slope is the ratio of vertical change to horizontal change, the rise over the run, so subtracting the y-coordinates gives the rise and subtracting the x-coordinates gives the run. Dividing one by the other yields a single number describing the line's steepness and direction. Substituting the slope and one point back into y equals mx plus b solves for the y-intercept, which fixes where the line crosses the vertical axis.

Source:Standard mathematics

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

Worked example

x₁:0y₁:0x₂:2y₂:4
m = (4 − 0) ÷ (2 − 0) = 2, and b = 0, so the line is y = 2x.

How to use this calculator

  1. 1

    Enter your values

    Enter x₁, y₁, x₂ and 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 does the slope tell me?

The slope describes both the steepness and the direction of a line. Its size shows how much y changes for each one-unit increase in x, so a slope of two means y climbs two units for every step right. The sign shows direction: positive slopes rise from left to right, negative slopes fall. A slope of zero is perfectly flat, describing a horizontal line whose y-value never changes.

What is the y-intercept?

The y-intercept is the point where the line crosses the vertical y-axis, which happens when x equals zero. In the equation y equals mx plus b, the letter b is that intercept value. The calculator finds it by taking your slope and plugging one of your points back into the equation. Knowing the intercept lets you draw the line immediately, since you have a fixed starting point and its slope.

Why is a vertical line's slope undefined?

A vertical line has two points with the same x-coordinate, so the run, the change in x, is zero. Because slope divides the rise by the run, and dividing by zero has no defined result, the slope of a vertical line simply does not exist. The calculator returns no value in that case. Vertical lines are instead written as x equals a constant rather than in slope-intercept form.

Does the order of the points matter?

No, as long as you stay consistent. Whether you subtract the first point from the second or the second from the first, the slope comes out the same because both the numerator and the denominator flip sign together, cancelling out. What you must not do is mix the order, subtracting y-values one way and x-values the other, since that reverses the sign and gives the wrong slope.

How do I find a line's full equation?

Once you have the slope, substitute it and either point into y equals mx plus b and solve for b, the y-intercept. With the slope and intercept in hand, you can write the complete equation. The calculator does this automatically, reporting the finished slope-intercept form for you. From there you can plot the line, find other points on it, or check whether a given point lies on the line.