BedrockCalculator
Figures cited to primary sourcesWritten by Aapt Dubey, MBA (Marketing & Banking), ISB 3 primary sourcesLast updated

Slope Calculator: Slope-Intercept Form from Two Points

The Slope Calculator: Slope-Intercept Form from Two Points finds the slope of a line from two points or a point and a slope, with slope-intercept, point-slope and standard forms, both intercepts and the line's angle.

Quick Answer: The slope of the line through (1, 2) and (5, 8) is 3/2: the line rises 6 for every 4 across. Its slope-intercept form is y = (3/2)x + 1/2, so it crosses the y-axis at 1/2.

Assumptions

Computed

Preset scenarios

Slope (m)
3/2
Slope-intercept form
y = (3/2)x + 1/2
Slope as a decimal
1.5
y-intercept (b)
(0, 1/2)
x-intercept
(-1/3, 0)
Point-slope form
y - 2 = (3/2)(x - 1)
Standard form
3x - 2y = -1
Rise over run
Rise 6 over run 4
Direction
Positive: rises from left to right
Angle with the x-axis
56.3099324740202°

Slopes and the angles they make

Download CSV
Each row is this calculator run in point-and-slope mode through the origin with the slope in the first column. Angles are shown to 15 significant figures.
SlopeEquationAngle with the x-axis
-2y = -2x-63.434948822922°
-1y = -x-45°
-0.5y = (-1/2)x-26.565051177078°
0y = 00°
0.1y = (1/10)x5.71059313749964°
0.25y = (1/4)x14.0362434679265°
0.5y = (1/2)x26.565051177078°
1y = x45°
1.5y = (3/2)x56.3099324740202°
2y = 2x63.434948822922°
3y = 3x71.565051177078°
10y = 10x84.2894068625004°

This table and its CSV are free to reuse with a link to this page, CC BY 4.0.

Slope Calculator: Slope-Intercept Form from Two Points: Slope (m) 3/2 (I know: Two points on the line; x₁: 1; y₁: 2; x₂ (two points): 5; y₂ (two points): 8).

Save or share this result

A one-page summary of this calculator's default example, drawn from the same calculation as the result above.

The infographic is free to reuse with a link to this page, CC BY 4.0.

Illustration of a wooden ramp rising over stone steps toward the porch of a white house
Quick Answer: The slope of the line through (1, 2) and (5, 8) is 3/2: the line rises 6 for every 4 across. Its slope-intercept form is y = (3/2)x + 1/2, so it crosses the y-axis at 1/2.

What does this calculator do?

This slope calculator finds the slope of a straight line and writes its equation in every common form. Give it two points, or one point and a slope, and it returns the slope as an exact fraction and as a decimal, and the slope-intercept form y = mx + b.

It also gives the point-slope form, the standard form Ax + By = C with whole numbers, both intercepts, the direction of the line and the angle it makes with the x-axis.

In slope-intercept form, y = mx + b, the slope is m: the number in front of x. It tells you how much y changes when x goes up by one. The y-intercept b is where the line crosses the y-axis. Everything else about a non-vertical line follows from those two numbers.

The arithmetic is exact. Coordinates are turned into fractions before anything is divided, so a slope of two thirds is reported as 2/3, not 0.666666666666667, and the intercept carries no rounding.

Using the Slope Calculator

  1. Choose whether you know two points or one point and the slope.
  2. Enter the coordinates. Decimals and negative numbers are fine.
  3. Read the slope at the top and the equations below. The point-slope form uses your first point.

The presets cover a point and a slope, a whole-number slope, a horizontal line and a vertical line.

How is this calculated?

  1. Make the coordinates exact. Each typed decimal becomes a fraction: 2.5 is 5/2.
  1. Slope from two points. The rise (change in y) is divided by the run (change in x), and the fraction is reduced. If the run is zero the line is vertical and its slope is undefined. If both points are the same, they do not define a line, and the calculator says so.

m = (y₂ − y₁)/(x₂ − x₁)

  1. y-intercept. Substituting the first point into y = mx + b and solving gives b.

b = y₁ − m x₁

  1. Equations. Slope-intercept form is y = mx + b. Point-slope form is y - y₁ = m(x - x₁). Standard form is found by clearing every fraction and dividing out any common factor, so that A, B and C are whole numbers with no common factor and A is not negative.

y − y₁ = m(x − x₁); Ax + By = C

  1. x-intercept. Setting y = 0 gives x = -b/m. A horizontal line that is not the x-axis has no x-intercept, and a vertical line has no y-intercept unless it is the y-axis.
  1. Angle and direction. The angle with the positive x-axis is the arctangent of the slope, in degrees, from -90° to 90° (90° for a vertical line). A positive slope rises from left to right; a negative one falls.

Worked Example

Using the defaults, the points (1, 2) and (5, 8):

  1. Rise: 8 - 2 = 6. Run: 5 - 1 = 4. Rise 6 over run 4.
  2. Slope: 6/4 = 3/2, or 1.5.
  3. y-intercept: b = 2 - (3/2)(1) = 1/2, so the line crosses the y-axis at (0, 1/2).
  4. Slope-intercept form: y = (3/2)x + 1/2.
  5. Point-slope form: y - 2 = (3/2)(x - 1).
  6. Standard form: multiply by 2 to clear the fractions and rearrange: 3x - 2y = -1.
  7. x-intercept: x = -(1/2) ÷ (3/2) = (-1/3, 0).

What Is the Slope in Slope-Intercept Form?

It is the coefficient of x. In y = 2x - 4, the slope is 2 and the y-intercept is -4; that is the line through (0, -4) and (3, 2) in the presets.

A line written another way, such as 2x - y = 4, can be rearranged into slope-intercept form by solving for y, and the slope is then whatever multiplies x.

How Do You Find the y-Intercept from a Slope and a Point?

Substitute the point into y = mx + b and solve for b. The Point (2, 3), slope -0.5 preset does exactly that: 3 = (-1/2)(2) + b, so b = 4, and the line is y = (-1/2)x + 4. It crosses the x-axis at (8, 0).

Is the Slope Positive or Negative?

Read the line from left to right. If it goes up, the slope is positive; if it goes down, negative; if it stays level, the slope is zero; if it is vertical, the slope is undefined. The (-2, 5) and (4, 5) preset is horizontal, with slope 0 and equation y = 5.

The (3, 1) and (3, 7) preset is vertical: the run is zero, the slope is undefined and the equation is x = 3.

Slopes and the Angles They Make

The reference table shows how slope relates to steepness. A slope of 1 is a 45° line. A slope of 0.1, a 10% grade, is only 5.71059313749964°, while a slope of 10 is 84.2894068625004°. Slope grows without limit as a line approaches vertical, even though the angle never passes 90°.

What does this calculator not account for?

  • Curves. Slope here is for straight lines. The slope of a curve changes from point to point and needs a derivative.
  • Lines of best fit. Fitting a line to many scattered points is linear regression, which minimises the squared vertical distances. This calculator uses exactly two points or one point and a slope.
  • Units. If x and y are measured in different units (metres and seconds), the slope has the unit of y per unit of x. The calculator works with the bare numbers.
  • Percent grade. A road grade is the slope times 100: a slope of 0.25 is a 25% grade.

What mistakes do people make with this?

  • Subtracting in different orders. (y₂ - y₁)/(x₂ - x₁) is right; (y₂ - y₁)/(x₁ - x₂) flips the sign.
  • Putting run over rise. Slope is change in y over change in x.
  • Calling a vertical line's slope zero. A horizontal line has slope zero. A vertical line has no slope at all.
  • Rounding a fractional slope. 2/3 rounded to 0.67 gives a line that misses the original points slightly. Keep the fraction.
  • Forgetting the sign of b. y = 2x - 4 has b = -4, not 4.

Frequently Asked Questions

How do I find the slope from two points?

Subtract the y values and divide by the difference of the x values in the same order: (8 - 2)/(5 - 1) = 3/2.

What is slope-intercept form?

y = mx + b, where m is the slope and b is the y-intercept.

How do I find the slope and the intercept from an equation?

Solve the equation for y. The number multiplying x is the slope and the constant is the y-intercept. For 3x - 2y = -1, y = (3/2)x + 1/2.

What does a slope of 0 mean?

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

Can a slope be a fraction?

Yes, and it usually is. The calculator reports it as a fraction in lowest terms and as a decimal.

Sources

Did this calculator answer your question?

How this calculator is tested

This calculator is checked by 5 automated test cases: specific inputs whose correct result is known in advance, and rules the output must always obey. They run on every change to the site. See the testing and corrections policy.

Show the test cases
  • Default: (1, 2) and (5, 8) give slope 3/2 and y = (3/2)x + 1/2
  • point and slope: (2, 3) with slope -0.5 gives b = 4
  • whole-number slope, horizontal and vertical lines
  • decimal coordinates stay exact: (0.1, 0.2) to (0.4, 0.4) has slope 2/3
  • builds the reference table from compute()

Add This Website as Preferred Source on Google

See Bedrock Calculator first in your Search results & AI Overviews