KitQuarter

Slope Calculator: Slope, Intercept and Equation

The slope of a line measures its steepness: how much y changes for each unit of x. Enter two points and this slope calculator returns the slope, the y-intercept, the line equation, the angle from the horizontal and the distance between the points.

KQ
Reviewed by the KitQuarter Editorial Team
Formulas verified against standard algebra references. Calculator logic tested in-browser across Chrome, Firefox and Safari. Last reviewed: October 2026. Our methodology

The slope formulas

Slope is rise over run — the change in y divided by the change in x between the two points. Once you have the slope, the rest of the line follows.

  • Slope: m = (y2 − y1) ÷ (x2 − x1)
  • Y-intercept: b = y1 − m·x1
  • Line equation: y = mx + b
  • Angle from horizontal: θ = arctan(m), in degrees
  • Distance: d = √((x2−x1)² + (y2−y1)²)

Sources: standard coordinate geometry — slope formula m = (y₂−y₁)/(x₂−x₁); angle via arctangent; distance via the Pythagorean theorem.

Worked example

Take the points (1, 2) and (4, 8). Rise = 8 − 2 = 6, run = 4 − 1 = 3, so the slope m = 6 ÷ 3 = 2. The intercept b = 2 − 2×1 = 0, giving the equation y = 2x. The angle is arctan(2) ≈ 63.43°, and the distance is √(3² + 6²) = √45 ≈ 6.708.

How to use the slope calculator

Enter the x and y coordinates of both points, then press Calculate. The calculator handles the special cases too: identical points are rejected, and vertical lines get a clear "undefined" answer instead of a broken formula.

Drag the dots to explore slope!

Slope m = 2 Rise 6 Run 3
Drag the blue and red dots — the slope, rise and run update live.

Step by step

  1. Enter point 1 (x1, y1). Either point can go first — swapping the points gives the same slope.
  2. Enter point 2 (x2, y2). Decimals and negative numbers are fine.
  3. Press Calculate. Read the slope, intercept, equation, angle and distance.
  4. Check the note. The result explains whether the line rises, falls or is horizontal.

Slope as a fraction

A slope of 2 is the same as the fraction 2/1: two units up for every one unit across. Thinking of slope as rise-over-run keeps the geometry visible. A fraction calculator can reduce rise/run fractions like 6/3 to their simplest form when you want the exact fractional slope.

What the slope tells you

The sign and size of the slope describe the line at a glance. Positive slopes climb left to right, negative slopes descend, zero is flat, and a vertical line has no slope at all.

Four line graphs showing positive, negative, zero and undefined slopes with labels
The four kinds of slope: positive, negative, zero and undefined.

Slope values and their meaning

Slope mDirectionWhat it means
m > 0Risingy increases as x increases — e.g. m = 2 climbs 2 units per 1 across
m < 0Fallingy decreases as x increases — e.g. m = −0.5 drops half a unit per 1 across
m = 0Horizontaly never changes — the line is flat, equation y = b
UndefinedVerticalx never changes — no run, so the slope formula divides by zero

Steepness versus direction

A common mix-up is reading −3 as "less steep" than 2. Steepness comes from the absolute value: |−3| = 3 beats |2| = 2, so the −3 line is steeper even though it falls. The sign only tells you the direction.

Reading the line equation

The equation y = mx + b packs the whole line into two numbers: m sets the tilt and b sets where it crosses the y-axis. With the equation you can find y for any x without redrawing the line.

From slope and intercept to equation

m (slope)b (intercept)Equation
20y = 2x
−1.54y = −1.5x + 4
0.25−3y = 0.25x − 3
15y = x + 5

Using the equation

To find the y value at x = 10 on the line y = 2x, substitute: y = 2 × 10 = 20. The intercept b is the value at x = 0, which is why it is called the y-intercept — it is where the line meets the vertical axis.

Angles come from the arctangent of the slope, and checking arctan by hand is tedious, so a scientific calculator with an inverse-tangent key is the practical way to verify the angle the calculator reports.

Vertical lines and the angle of inclination

A vertical line like x = 3 has points (3, 1) and (3, 5): the run is 3 − 3 = 0, so rise ÷ run divides by zero and the slope is undefined. It is not zero — zero slope means a horizontal line.

Diagram showing the angle of inclination of the line y = 2x as arctan(2), about 63.43 degrees from the horizontal
The line y = 2x meets the horizontal at about 63.43°.

Angle facts

Line typeSlopeAngle from horizontal
Gently risingm = 0.5≈ 26.57°
45° linem = 145°
Steep risingm = 2≈ 63.43°
Horizontalm = 00°
Verticalundefined90°

Why the angle matters

Angles turn abstract slopes into something you can picture: a ramp, a roof pitch, a hillside. An angle near 0° is nearly flat, 45° is the diagonal you know from graph paper, and anything past 60° looks genuinely steep.

Frequently asked questions

What is the slope of a line?

The slope measures how steep a line is: the change in y divided by the change in x between any two points on the line. A slope of 2 means y rises 2 units for every 1 unit x moves right. It is often written as the letter m.

How do you calculate slope from two points?

Subtract the y-coordinates to get the rise, subtract the x-coordinates to get the run, then divide: m = (y2 − y1) ÷ (x2 − x1). For (1, 2) and (4, 8): rise = 6, run = 3, slope = 2.

What does it mean when slope is undefined?

It means the line is vertical. When x2 − x1 = 0, the slope formula divides by zero, which has no answer. A vertical line has an equation like x = 3 and makes a 90° angle with the horizontal.

What is the difference between zero slope and undefined slope?

Zero slope is a horizontal line (y = 5) — the line exists with no tilt. Undefined slope is a vertical line (x = 3) — the slope formula itself breaks. Mixing them up is one of the most common errors in coordinate geometry.

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

First find the slope m, then find b = y1 − m·x1, and write y = mx + b. For (1, 2) and (4, 8): m = 2, b = 0, so the equation is y = 2x.

How do you find the angle of a line?

Take the arctangent of the slope: angle = arctan(m), converted to degrees. A slope of 2 gives arctan(2) ≈ 63.43°. Positive slopes tilt up to the right; the angle is measured from the horizontal.

What is the y-intercept?

The y-intercept is where the line crosses the y-axis — the value of y when x = 0. In y = mx + b it is the number b. A line through (1, 2) and (4, 8) has intercept 0, so it passes through the origin.