Slope Calculator

Slope Calculator

Enter two points and get the slope (rise over run), the angle of the line in degrees, its percent grade, the distance and midpoint between the points, and the equation of the line in slope-intercept form. Vertical lines are reported as undefined slope instead of an error.

Slope (m)2
Angle of incline (degrees)63.43495
Distance4.472136
Δx2
Δy4
y-intercept (b)0
Line equationy = 2x + 0
Percent grade200%
Perpendicular slope-0.5
Midpoint2, 4

m = (y₂ − y₁) ÷ (x₂ − x₁) = (6 − 2) ÷ (3 − 1) = 4 ÷ 2 = 2; angle = atan(2) = 63.43495°; b = y₁ − m·x₁ = 0.

Calculated on your device · formulas checked against known results · How we test

How to use the slope calculator

Type the coordinates of any two points on the line; negative numbers and decimals are fine. The cards show the slope m, the angle the line makes with the horizontal, the distance between the points, and the changes Δx and Δy. The rows give the y-intercept, the equation y = mx + b with a copy button, the percent grade, the perpendicular slope and the midpoint.

The slope formula

Slope is the change in y divided by the change in x — rise over run:

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

A positive slope rises from left to right, a negative slope falls, zero means a horizontal line, and when x₁ = x₂ the run is zero and the slope is undefined: the line is vertical. The order of the points does not matter as long as you subtract in the same order on top and bottom.

Worked example

For the points (2, 3) and (5, 11): Δx = 5 − 2 = 3 and Δy = 11 − 3 = 8, so m = 8 ÷ 3 = 2.667. The angle is atan(2.667) = 69.44°. Distance = √(3² + 8²) = √73 = 8.544. The y-intercept is b = y₁ − m x₁ = 3 − 2.667 × 2 = −2.333, giving the equation y = 2.667x − 2.333. The midpoint is ((2 + 5) ÷ 2, (3 + 11) ÷ 2) = (3.5, 7). Any line perpendicular to this one has slope −1 ÷ 2.667 = −0.375.

Angle, percent grade and ratio

The same steepness can be written three ways:

Slope mPercent gradeAngleTypical use
0.055%2.86°Steep stretch of interstate
0.08338.33%4.76°1:12 accessibility ramp
0.33333.3%18.43°4:12 roof, a common low pitch
0.550%26.57°6:12 roof
1100%45°12:12 roof
2200%63.43°Steep staircase stringer

Forms of a line equation

Slope-intercept form y = mx + b is what the calculator returns: m is the slope and b is where the line crosses the y-axis (y when x = 0). Point-slope form y − y₁ = m(x − x₁) is handy when you know the slope and one point; expanding it gives the slope-intercept form. Parallel lines share a slope; perpendicular lines have slopes whose product is −1, so the perpendicular to m is −1 ÷ m.

Where slope shows up

Slope is a rate of change: on a distance-time graph it is speed. Builders use it to set drainage (a patio should fall about 2%, or ¼ inch per foot, away from the house). For the angle alone, the scientific calculator evaluates atan and tan in degrees or radians.

Frequently asked questions

What is the slope of a vertical line?

Undefined. Both points have the same x, so the run x₂ − x₁ is zero and the formula divides by zero. The line is written as x = c (for example x = 1), has no y-intercept unless it is the y-axis itself, and its angle is 90°.

How do I find the slope from an equation?

Rearrange it into y = mx + b; the coefficient of x is the slope. From 3x + 2y = 12: 2y = −3x + 12, so y = −1.5x + 6 and the slope is −1.5. From point-slope form y − y₁ = m(x − x₁), m is already visible.

How do I convert a slope to an angle?

Take the inverse tangent: angle = atan(m) in degrees. A slope of 0.5 is atan(0.5) = 26.57°; a slope of 2 is 63.43°. Going the other way, m = tan(angle): a 30° slope is tan(30°) = 0.577, or a 57.7% grade.

What is the difference between slope and percent grade?

Percent grade is the slope multiplied by 100. A slope of 0.06 is a 6% grade: 6 units of rise for every 100 units of run. Roads and ramps are labeled in percent, roofs in rise-per-12 pitch, and math classes use the plain decimal or fraction.

How do I find the midpoint and distance between two points?

The midpoint averages the coordinates: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2). The distance uses the Pythagorean theorem on Δx and Δy: d = √(Δx² + Δy²). For (1, 2) and (3, 6), the midpoint is (2, 4) and the distance is √(4 + 16) = 4.472.

Embed this calculator on your website

Free for any website or blog. Paste this code where you want the calculator to appear:

All free calculator widgets

Last updated: October 9, 2026

Menu

Categories

Finance Calculators24 calculatorsBusiness & Shopping Calculators8 calculatorsHealth & Fitness Calculators9 calculatorsMath & School Calculators19 calculatorsDate & Time Calculators12 calculatorsHoliday Countdowns16 calculatorsEveryday Tools16 calculators

CalcWorthy

AboutContactPrivacy PolicyTerms of Use

Language

Language
EnglishEnglishالعربيةArabicবাংলাBanglaDeutschGermanEspañolSpanishفارسیPersianFrançaisFrenchעבריתHebrewहिन्दीHindiBahasa IndonesiaIndonesianItalianoItalian日本語Japanese한국어KoreanBahasa MelayuMalayNederlandsDutchPolskiPolishPortuguêsPortugueseРусскийRussianไทยThaiTürkçeTurkishУкраїнськаUkrainianاردوUrduTiếng ViệtVietnamese简体中文Simplified Chinese