Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Slope Calculator

Enter two points to get the slope as an exact fraction and the equation of the line through them.

Examples

About the Slope Calculator

The slope of a line measures how steeply it rises or falls: the change in yy divided by the change in xx between any two points. A positive slope rises to the right, a negative slope falls, zero is horizontal, and a vertical line has an undefined slope.

Once the slope mm is known, the y-intercept bb follows from either point, giving the line y=mx+by = mx + b.

What is the slope of a line?

Slope is a single number that describes the steepness and direction of a straight line. It is defined as rise over run: how far the line goes up or down for every unit it moves to the right. A slope of 2 means the line climbs 2 units for each step right, a slope of −32-\frac32 means it falls 3 units for every 2 to the right, and a slope of 0 means it is flat.

Because a straight line has the same steepness everywhere, any two points on it give the same slope. That makes the slope the key to the line's equation: once you know mm and one point, the whole line is determined. In everyday terms slope is a rate of change, such as kilometres per hour on a distance-time graph or dollars per item on a cost graph.

How to use the Slope Calculator

  1. Enter the coordinates of the first point (x₁, y₁).
  2. Enter the coordinates of the second point (x₂, y₂).
  3. Press Find slope to see rise, run, the reduced slope and the line equation.

Formulas

Slope

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}

Slope-intercept form

y=mx+b,b=y1−mx1y = mx + b,\quad b = y_1 - m x_1

Point-slope form

y−y1=m(x−x1)y - y_1 = m(x - x_1)

Worked example: (2, 3) and (6, 11)

The worked example uses the points (2, 3) and (6, 11). The rise is 11−3=811 - 3 = 8 and the run is 6−2=46 - 2 = 4, so the slope is 84=2\frac84 = 2. Using the first point, the intercept is b=3−2⋅2=−1b = 3 - 2 \cdot 2 = -1, giving the line y=2x−1y = 2x - 1. The check substitutes the second point: 2⋅6−1=112 \cdot 6 - 1 = 11, as expected.

The solution below is generated by the same engine that powers the calculator above.

Final answer

m=2,y=2x−1m = 2,\quad y = 2x - 1

How we read your problem

Find the slope (rate of change) of the line through two points.

Step-by-step solution

  1. Label the points

    (x1,y1)=(2,3),(x2,y2)=(6,11)(x_1, y_1) = (2, 3),\quad (x_2, y_2) = (6, 11)
  2. Find the change in y (rise)

    y2−y1=11−3=8y_2 - y_1 = 11 - 3 = 8
  3. Find the change in x (run)

    x2−x1=6−2=4x_2 - x_1 = 6 - 2 = 4
  4. Divide rise by run

    m=84=2m = \frac{8}{4} = 2
  5. Find the y-intercept using the first point

    b=y1−mx1=3−2⋅2=−1b = y_1 - m x_1 = 3 - 2 \cdot 2 = -1
  6. Write the equation of the line

    y=2x−1y = 2x - 1

Formulas used

  • Slope

    m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}
  • Slope-intercept form

    y=mx+by = mx + b

The slope is 2: for every 1 unit increase in x, y changes by 2. The line rises from left to right.

Verification

  • Second point: 2·(6) + -1 = 11 (expected 11)

Detailed explanation

Negative, fractional and undefined slopes

For the points (1, 2) and (5, −4) the rise is −6-6 and the run is 4, so the calculator reports m=−32m = -\frac32 and the line y=−32x+72y = -\frac32 x + \frac72, keeping both values as exact fractions instead of −1.5 and 3.5. For (3, 1) and (3, 7) the run is zero; division by zero is not allowed, so the slope is undefined and the calculator reports the vertical line x=3x = 3 instead of a y=mx+by = mx + b equation.

Three ways to write the line

Slope-intercept form y=mx+by = mx + b shows the slope and the y-intercept at a glance and is the form most graphing tools expect. Point-slope form y−y1=m(x−x1)y - y_1 = m(x - x_1) is quicker to write when you have a point and a slope but have not found the intercept yet. Standard form Ax+By=CAx + By = C with integer coefficients is preferred in some courses; from y=2x−1y = 2x - 1 it is 2x−y=12x - y = 1. All three describe the same set of points.

Slope as a rate of change

In applied problems the slope carries units: the units of y divided by the units of x. If a taxi charges 11 dollars for a 6 km ride and 3 dollars for a 2 km ride, the slope through (2, 3) and (6, 11) is 2 dollars per kilometre, and the intercept of −1 is the value of the line at zero distance. Read that way, the slope answers the question how much does y change when x increases by one, which is the same idea that the derivative extends to curves.

Common mistakes

  • Subtracting in a different order on top and bottom, for example y2−y1y_2 - y_1 over x1−x2x_1 - x_2.
  • Writing run over rise instead of rise over run.
  • Calling the slope of a vertical line 0; it is undefined.
  • Using the coordinates of one point as if they were rise and run.
  • Simplifying 84\frac{8}{4} wrongly or dropping a minus sign from the run when the x-values decrease.

Tips

  • Parallel lines have equal slopes; perpendicular lines have slopes whose product is −1.
  • Keep the slope as a fraction to avoid rounding when finding the intercept.
  • Plot both points on the graphing calculator to sanity-check the sign.
  • Before calculating, picture the points: if the second is higher and to the right, the slope must be positive.
  • The slope of a perpendicular line is the negative reciprocal: a line perpendicular to y=2x−1y = 2x - 1 has slope −12-\frac12.

Frequently asked questions

How do I find the slope between two points?

Subtract the y-values, subtract the x-values in the same order, and divide. For (2, 3) and (6, 11): m=11−36−2=2m = \frac{11-3}{6-2} = 2.

What does a negative slope mean?

The line goes down as x increases. A slope of −32-\frac32 drops 3 units for every 2 units to the right.

Why is the slope of a vertical line undefined?

Both points have the same x, so the run is 0 and the formula would divide by zero. The line is written as x=cx = c instead.

How do I get the equation of the line?

Compute the slope, then use b=y1−mx1b = y_1 - m x_1 to find the y-intercept and write y=mx+by = mx + b.

Does the order of the points matter?

No. Swapping the points changes the sign of both differences, so the quotient is the same.

Can I enter decimal coordinates?

Yes. Decimals are converted to exact fractions so the slope and intercept stay exact.

What is the slope of a horizontal line?

Zero. Both points have the same y-value, so the rise is 0 and 0run=0\frac{0}{\text{run}} = 0. The line is written y=cy = c.

How do I find a perpendicular slope?

Take the negative reciprocal of the original slope. If m=−32m = -\frac32, a perpendicular line has slope 23\frac23, and the product of the two slopes is −1-1.

How can I tell if two lines are parallel?

Compare their slopes. Non-vertical lines are parallel exactly when their slopes are equal and their intercepts differ; y=2x−1y = 2x - 1 and y=2x+4y = 2x + 4 never meet.

Find the slope of your line

Enter two points above to get the slope as an exact fraction, the y-intercept and the equation of the line through them.

More math calculators