# Slope Calculator

> Find the slope between two points as a decimal and a fraction, the line’s equation y = mx + b, its angle, the distance and the midpoint.

Category: Algebra, geometry & advanced math · Applies to: Worldwide · Last updated: 2026-10-29
Interactive calculator: https://calculators.geekmidst.com/calculators/slope-calculator

Slope is rise over run: how much y changes for each step in x. Enter two points to get the slope and the equation of the line through them.

Also called: Gradient calculator, Rise over run calculator.

## Inputs
- x₁ (default 1)
- y₁ (default 2)
- x₂ (default 5)
- y₂ (default 5)

## Results
- Slope (m)
- Slope as a fraction
- Equation of the line
- y-intercept (b)
- Angle to the x-axis
- Rise (Δy)
- Run (Δx)
- Distance between the points
- Midpoint

## Formula

```
m = (y₂ − y₁) ÷ (x₂ − x₁);  b = y₁ − m·x₁;  θ = arctan m;  d = √((x₂ − x₁)² + (y₂ − y₁)²)
```

Where:
- (x₁, y₁), (x₂, y₂): the two points
- m: slope
- b: where the line crosses the y-axis
- θ: angle of the line above the x-axis

## Worked example
1. Rise = 5 − 2 = 3; run = 5 − 1 = 4; m = 3 ÷ 4 = 0.75.
2. b = 2 − 0.75 × 1 = 1.25, so y = 0.75x + 1.25.
3. Distance = √(4² + 3²) = √25 = 5.

**Result:** The line through (1, 2) and (5, 5) has slope 3/4 and equation y = 0.75x + 1.25.

## What the result means

A positive slope rises from left to right, a negative one falls. A slope of 0.75 means y goes up 3 for every 4 across, or 75% as a road or ramp grade.

## Assumptions and limits
- Points are on a flat x–y plane with the same scale on both axes (the angle depends on this).
- A vertical line (x₁ = x₂) has no defined slope; the calculator gives its equation as x = constant.

## Questions

### What is the difference between slope and grade?

Grade is slope written as a percentage: a slope of 0.05 is a 5% grade, rising 5 m over 100 m horizontally.

### Do parallel and perpendicular lines have related slopes?

Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1, such as 2 and −½.

## Related calculators
- [Quadratic Formula Calculator](https://calculators.geekmidst.com/calculators/quadratic-formula-calculator)
- [Triangle Calculator](https://calculators.geekmidst.com/calculators/triangle-calculator)
- [Percentage Calculator](https://calculators.geekmidst.com/calculators/percentage-calculator)

Source: GM¹X CalcVerse — https://calculators.geekmidst.com/calculators/slope-calculator
