Slope Calculator

Find the slope and equation of a line.

  • No signup required
  • Instant results
  • Step-by-step solutions

Point 1 (x₁, y₁)

Point 2 (x₂, y₂)

Press Enter to submit

Better Analyst AI data analysis

Go beyond one calculation with Better Analyst

Upload an Excel, CSV, or PDF file to analyze a complete dataset, ask follow-up questions, create charts, and get clear answers in seconds.

No credit card required. Free plan included.

Try Better Analyst free

What Is a Slope Calculator?

A slope calculator finds the slope of a line passing through two points on a coordinate plane. Enter the coordinates (x1, y1) and (x2, y2), and the calculator computes the slope (m), the y-intercept (b), the slope-intercept equation (y = mx + b), and the distance between the two points.

Slope represents the rate of change between two points, describing how steep a line is and whether it rises or falls. Understanding slope is fundamental to algebra, geometry, calculus, and countless real-world applications from road grades to stock price trends.

Common Use Cases

  • Algebra homework - Find slope from two points and write the equation of the line
  • Graphing lines - Determine slope and y-intercept to plot linear equations accurately
  • Rate of change - Calculate how quickly a variable changes relative to another (speed, growth, decline)
  • Construction - Determine the grade of a road, ramp, roof pitch, or drainage slope
  • Data analysis - Find the trend line between two data points in statistics or business analysis
  • Geometry proofs - Verify that lines are parallel (same slope), perpendicular (negative reciprocal slopes), or neither

Why Slope Calculations Trip People Up

  • Coordinate order - Subtracting (y1 - y2) instead of (y2 - y1) while using (x2 - x1) flips the sign
  • Negative signs - When coordinates are negative, double negatives in the subtraction cause frequent errors
  • Undefined slope - Vertical lines (where x1 = x2) have undefined slope, which is different from zero slope
  • Fraction simplification - Slope often produces fractions that need to be reduced to simplest form

How It Works

The slope formula is m = (y2 - y1) / (x2 - x1). This calculates the "rise over run," or how much the line goes up (or down) for every unit it moves to the right. A positive slope means the line rises from left to right. A negative slope means it falls. A slope of zero means the line is horizontal.

Once the slope is found, the y-intercept is calculated by substituting one point into y = mx + b and solving for b. The distance between the two points uses the distance formula: d = the square root of ((x2 - x1)² + (y2 - y1)²), which is an application of the Pythagorean theorem.

Example

Points: (2, 3) and (8, 15)

Slope = (15 - 3) / (8 - 2) = 12 / 6 = 2. Y-intercept: 3 = 2(2) + b, so b = -1. Equation: y = 2x - 1. Distance = the square root of (36 + 144) = the square root of 180 = approximately 13.42.

Key Examples

  • (0, 0) and (4, 4) - Slope: 1, Equation: y = x (45-degree line through the origin)
  • (1, 5) and (3, 1) - Slope: -2, Equation: y = -2x + 7 (falling line)
  • (2, 3) and (6, 3) - Slope: 0, Equation: y = 3 (horizontal line)
  • (4, 1) and (4, 7) - Slope: undefined (vertical line, x = 4)
  • (-3, -2) and (5, 6) - Slope: 1, Equation: y = x + 1 (negative coordinates, positive slope)

Benefits of Using a Slope Calculator

  • Complete analysis - Get slope, y-intercept, equation, and distance all from two points
  • Sign accuracy - Eliminate the negative sign errors that plague manual slope calculations
  • Instant equation - Go directly from two points to the full slope-intercept equation y = mx + b
  • Special case handling - Correctly identifies horizontal lines (slope = 0) and vertical lines (undefined slope)
  • Distance included - The distance between points is calculated automatically using the distance formula

Frequently Asked Questions

What does a slope of 0 mean?

A slope of 0 means the line is perfectly horizontal. The y-values are the same for both points, so there's no rise. The equation is simply y = b (a constant). Don't confuse zero slope (horizontal line) with undefined slope (vertical line). They are very different.

What does undefined slope mean?

Undefined slope occurs when the two points have the same x-coordinate, creating a vertical line. The formula produces a division by zero (x2 - x1 = 0). Vertical lines are written as x = a (a constant), not in y = mx + b form. They cannot be expressed with a numeric slope.

How do I know if two lines are parallel or perpendicular?

Parallel lines have equal slopes (m1 = m2). Perpendicular lines have slopes that are negative reciprocals of each other (m1 x m2 = -1). For example, a line with slope 2 is perpendicular to a line with slope -1/2. A line with slope 3 is parallel to any other line with slope 3.

What is rise over run?

"Rise over run" is the intuitive way to think about slope. The rise is the vertical change (y2 - y1) and the run is the horizontal change (x2 - x1). If you go up 3 and right 4, the slope is 3/4. If you go down 2 and right 5, the slope is -2/5. The sign tells you the direction.

Does it matter which point is (x1, y1) and which is (x2, y2)?

No. As long as you're consistent, the result is the same. If you use point A as (x1, y1), use point A's coordinates in both the numerator and denominator. Swapping the points negates both the numerator and denominator, so the slope remains unchanged.

How is slope used in real life?

Slope appears everywhere. Road grades are expressed as percentage slope (a 6% grade rises 6 feet per 100 feet). Roof pitch is rise over run (a 4/12 pitch rises 4 inches per 12 inches of horizontal run). In business, slope represents the rate of change in revenue, costs, or growth over time.

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.

More Calculators