Slope Calculator

Slope, angle and line equation through two points.

Enter details

Slope (m)

2

Equation
y = 2x + 0
Angle
63.4349°
Distance
6.708204

How slope (m) changes with

x₁: 0.5 → 1.7142861.5 → 2.4

The dot is your current value. The graph updates as you type.

Formula: m = (y₂ − y₁) ÷ (x₂ − x₁); y = mx + b

Slope Calculator: Find Slope, Line Equation & Angle

Short answer

The Slope Calculator determines the steepness and direction of a line passing through two Cartesian points: (x₁, y₁) and (x₂, y₂). It calculates the slope (m), the slope-intercept equation (y = mx + b), the angle of inclination in degrees, and the straight-line distance between the points. For the points (1, 2) and (4, 8), the slope is exactly 2, yielding the equation y = 2x + 0.

Formula

m = (y₂ − y₁) / (x₂ − x₁); b = y₁ − m × x₁; θ = arctan(m) × (180 / π); d = √((x₂ − x₁)² + (y₂ − y₁)²)

m represents the slope (rise over run); (x₁, y₁) are the coordinates of the first point; (x₂, y₂) are the coordinates of the second point; b is the y-intercept where the line crosses the y-axis; θ is the angle of inclination relative to the positive x-axis in degrees; d is the Euclidean distance between the two points.

Worked example

x₁
1
y₁
2
x₂
4
y₂
8
  • Slope (m): 2
  • Equation: y = 2x + 0
  • Angle: 63.4349°
  • Distance: 6.708204

What the Slope Calculator Does

The Slope Calculator determines key linear properties between any two points on a two-dimensional Cartesian plane. Whether you are solving algebra problems, designing wheelchair ramps, laying drainage pipes, or analyzing linear trend lines, understanding the steepness and direction of a line is essential.

Given two coordinates, $(x_1, y_1)$ and $(x_2, y_2)$, this tool computes four distinct outputs:

  1. Slope ($m$): The rate of vertical change per unit of horizontal change (rise over run).
  2. Line Equation: The linear relationship expressed in slope-intercept form ($y = mx + b$).
  3. Angle of Inclination: The counterclockwise angle the line makes with the positive x-axis, expressed in degrees.
  4. Distance: The straight-line Euclidean distance between the two points.

Step-by-Step Worked Example

To understand how the mathematics works, consider two points:

  • Point 1: $(x_1, y_1) = (1, 2)$
  • Point 2: $(x_2, y_2) = (4, 8)$

Step 1: Calculate the Slope ($m$)

Subtract the coordinates to find the vertical difference ($Δy$) and horizontal difference ($Δx$): $$\Delta y = y_2 - y_1 = 8 - 2 = 6$$ $$\Delta x = x_2 - x_1 = 4 - 1 = 3$$ $$m = \frac{\Delta y}{\Delta x} = \frac{6}{3} = 2$$

The slope is 2, meaning the line rises 2 vertical units for every 1 horizontal unit moved to the right.

Step 2: Find the y-Intercept ($b$) and Line Equation

Using the slope-intercept formula $y = mx + b$, plug in $m = 2$ and Point 1 $(1, 2)$: $$2 = 2(1) + b$$ $$2 = 2 + b \implies b = 0$$

The resulting line equation is $y = 2x + 0$ (or simply $y = 2x$).

Step 3: Compute the Angle of Inclination

Take the arctangent of the slope to find the angle in radians, then convert to degrees: $$\theta = \arctan(2) \approx 1.10715 \text{ radians}$$ $$\theta = 1.10715 \times \left(\frac{180^\circ}{\pi}\right) \approx 63.4349^\circ$$

Step 4: Calculate the Distance between Points

Apply the Pythagorean distance theorem: $$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$$ $$d = \sqrt{(3)^2 + (6)^2} = \sqrt{9 + 36} = \sqrt{45} \approx 6.708204$$


How to Interpret Slope Values

Slope values follow well-defined mathematical principles:

  • Positive Slope ($m > 0$): The line rises from left to right. An angle between $0^\circ$ and $90^\circ$.
  • Negative Slope ($m < 0$): The line falls from left to right. An angle between $-90^\circ$ and $0^\circ$ (or $90^\circ$ to $180^\circ$).
  • Zero Slope ($m = 0$): A perfectly horizontal line. There is no vertical change regardless of horizontal movement ($y = b$).
  • Undefined Slope ($m = \infty$): A perfectly vertical line ($x_1 = x_2$). The horizontal change is zero, causing division by zero ($x = c$).
  • Magnitude Benchmarks: A slope of $1$ corresponds to a $45^\circ$ angle (a 1:1 rise-to-run ratio). Slopes with an absolute value greater than 1 are steeper than $45^\circ$, while slopes between 0 and 1 are flatter than $45^\circ$.

Practical Tips for Accurate Calculations

  • Preserve Negative Signs: Double negatives are the most common source of manual calculation errors. For example, if $x_1 = -3$ and $x_2 = 5$, then $x_2 - x_1 = 5 - (-3) = 8$.
  • Maintain Pairing Consistency: It does not matter which point is designated as Point 1 or Point 2, provided you subtract in the same direction for both coordinates: $(y_2 - y_1) / (x_2 - x_1)$ equals $(y_1 - y_2) / (x_1 - x_2)$.
  • Unit Consistency: Ensure both axes share the same measurement units when calculating geometric distances and real-world inclinations. Mixing feet on one axis with inches on another distorts the slope.

When Not to Rely on a Standard Slope Formula

While the standard Cartesian slope formula is exact for planar geometry, it is not suitable in all contexts:

  • Curved Trajectories: Non-linear curves require calculus (the first derivative) to evaluate instantaneous slope at a single point rather than an average slope over an interval.
  • Geographic Distances: Over large global distances, Earth's curvature invalidates flat Cartesian coordinates. Geodetic models or great-circle formulas should be used instead.
  • Extreme Structural Loads: In construction and civil grading, theoretical slope does not account for soil compaction, friction, or drainage runoff requirements governed by local building codes.

Comparison

ScenarioInputResult
Lower inputx₁: 0.8Slope (m): 1.875
Base examplex₁: 1Slope (m): 2
Higher inputx₁: 1.2Slope (m): 2.142857

Common mistakes

  • Inverting the slope formula to (x₂ − x₁) / (y₂ − y₁), which computes run-over-rise instead of rise-over-run.
  • Mixing point orders during subtraction, such as computing (y₂ − y₁) in the numerator but (x₁ − x₂) in the denominator.
  • Confusing a slope of zero (a flat, horizontal line) with an undefined slope (a vertical line where dx = 0).
  • Dropping negative signs when evaluating coordinates like y₂ − y₁ where y₁ is negative.
  • Assuming a steep slope must always be positive, overlooking steep downward-sloping lines with large negative values.

Checklist

  • Verify the correct order of coordinates as (x, y) rather than reversing them as (y, x).
  • Keep consistent pairs: subtract point 1 from point 2 for both axes, or vice versa.
  • Pay close attention to double negatives when coordinates have negative values (e.g., subtracting −3 becomes +3).
  • Check if the change in x equals zero (x₂ = x₁), which indicates a vertical line with an undefined slope.
  • Check if the change in y equals zero (y₂ = y₁), which indicates a horizontal line with a slope of zero.
  • Ensure both points are not identical, as two distinct points are required to define a line.

Calculators Percentage Editorial Team

Calculator guides from the Calculators Percentage team. These introductory examples are educational, not professional advice.

Last reviewed:

This calculator computes theoretical geometric values based on standard Cartesian coordinate formulas. Always verify critical measurements with certified survey equipment or professional engineering standards for real-world construction and grading.

Frequently Asked Questions

How is slope calculated between two points?

Slope is calculated as the ratio of vertical change (rise) to horizontal change (run) between two points. Using the formula m = (y₂ − y₁) / (x₂ − x₁), you subtract the first y-coordinate from the second y-coordinate and divide by the difference of the corresponding x-coordinates. A positive value means the line rises from left to right, while a negative value means it falls.

What does an undefined slope mean?

An undefined slope occurs when a line is perfectly vertical, meaning x₁ equals x₂. In this scenario, the denominator (x₂ − x₁) equals zero, and division by zero is mathematically undefined. The equation of such a line is written simply as x = c, where c is the constant x-value.

What is the difference between a zero slope and an undefined slope?

A zero slope represents a horizontal line where y does not change (dy = 0), producing an equation of the form y = c. An undefined slope represents a vertical line where x does not change (dx = 0), creating division by zero. A horizontal line has zero steepness, whereas a vertical line is infinitely steep.

How do you find the angle of inclination from the slope?

The angle of inclination (θ) is the angle the line makes with the positive horizontal axis. It is calculated by taking the arctangent of the slope: θ = arctan(m). To convert the result from radians to degrees, multiply by 180 and divide by π.

How do you find the y-intercept once you know the slope?

Once slope m is determined, use the slope-intercept form y = mx + b and substitute the coordinates of either point into the equation. Rearranging gives b = y₁ − (m × x₁). This value b indicates the point (0, b) where the line crosses the y-axis.

Can slope be expressed as a percentage?

Yes, slope can be converted to a percentage grade, commonly used in civil engineering, road signage, and roofing. To find the percent grade, multiply the absolute value of the slope by 100. For example, a slope of 0.05 equals a 5% grade.

Sources & references

Formulas are tested against hand-checked answers. How we check our calculators.

Estimates only. Confirm final figures, terms and fees with your bank, provider or a qualified professional.

Last updated: January 15, 2026