Smekys
Ad Space

Slope Calculator

Free slope calculator finds the slope of a line from two points, plus angle of incline, y-intercept, x-intercept, distance, midpoint and the line equation.

Enter Values

units

The horizontal coordinate of the first point (x1, y1).

units

The vertical coordinate of the first point (x1, y1).

units

The horizontal coordinate of the second point (x2, y2).

units

The vertical coordinate of the second point (x2, y2).

Result

Slope (m)
1.33
Angle of Incline
53.1°
Y-Intercept (b)
0
X-Intercept
-0
Grade
133.33%
Distance Between Points
5
Midpoint X
1.5
Midpoint Y
2
Line Equation
1.33

Slope measures how steeply a line rises or falls as you move from left to right. It is the foundation of graphing linear equations, reading a roof pitch, designing a wheelchair ramp, interpreting a road grade, and understanding the rate of change in nearly every field from physics to economics. This slope calculator takes any two points on a line and returns the slope, the angle of incline, both intercepts, the percent grade, and the full slope-intercept equation.

Enter four coordinates — the x and y of Point 1 and Point 2 — and the result updates instantly. Whether your line climbs upward, drops downward, runs flat, or stands straight up, the calculator reports it correctly and explains what the number means.

How to Use

  1. Enter the x coordinate of Point 1 (x1) — how far right the first point sits on the horizontal axis.
  2. Enter the y coordinate of Point 1 (y1) — how high or low the first point sits.
  3. Enter the x coordinate of Point 2 (x2) and the y coordinate of Point 2 (y2). Any order works; the slope comes out the same either way.
  4. Read the result card: the Slope (m) is highlighted, followed by the Angle of Incline in degrees, the Y-Intercept, the X-Intercept, the Grade as a percent, and the finished Line Equation.

A positive slope means the line climbs from left to right. A negative slope means it drops. A slope of exactly zero is a flat horizontal line. If Point 1 and Point 2 share the same x coordinate, the line is vertical, the run is zero, and the slope is mathematically undefined — the calculator flags this as an error rather than dividing by zero.

The Slope Formula

Slope is defined as rise divided by run:

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

Where:

  • m is the slope.
  • rise is the vertical change, y₂ − y₁.
  • run is the horizontal change, x₂ − x₁.

Once you know m, the angle of incline is the angle whose tangent equals the slope: angle = atan(m), converted from radians to degrees. The line itself can be written in slope-intercept form y = m·x + b, where the y-intercept b = y₁ − m·x₁. The x-intercept — where the line crosses the horizontal axis — is −b / m.

A slope of 1 means a 45° angle: rise equals run. A slope of 2 climbs twice as fast horizontally as it moves right, for about a 63.4° angle. Road builders express the same steepness as a grade percent: multiply the slope by 100, so a slope of 0.06 becomes a 6% grade, which is common on steep mountain highways.

Examples

Example 1 — A simple upward line. Points (0, 0) and (3, 6). The rise is 6 − 0 = 6 and the run is 3 − 0 = 3, so the slope is 6 / 3 = 2. The angle is about 63.4°, the y-intercept is 0, and the equation is y = 2x. Each step to the right raises the line by two units.

Example 2 — A flat roof edge. Points (1, 4) and (6, 4). The rise is 4 − 4 = 0, so the slope is 0, the angle is 0°, and the y-intercept is 4. The x-intercept does not exist because the line never crosses the x-axis — it runs parallel to it.

Example 3 — A downhill descent with negative coordinates. Points (−5, 10) and (5, 0). The rise is 0 − 10 = −10 and the run is 5 − (−5) = 10, giving a slope of −1. The angle is −45°, the y-intercept is 5, and the equation is y = −x + 5. Negative coordinates are handled exactly the same way as positive ones.

Example 4 — A large-scale engineering survey. Points (0, 0) and (1,000,000, 250,000). The slope is 250,000 / 1,000,000 = 0.25, the angle is about 14.04°, and the grade is 25%. This is the same math used when a surveyor measures a road bed over a long baseline.

Example 5 — A unit-cost reading. Suppose a subscription costs $5 setup plus $2 per month: after 1 month you owe $7, after 6 months you owe $17. Treating months as x and dollars as y, points (1, 7) and (6, 17) give a slope of (17 − 7) / (6 − 1) = $2 per month and a y-intercept of $5 — exactly the setup fee. The slope here is a real rate of change, not just a number on a graph.

FAQ

How do I calculate slope from two points?

Subtract the y-coordinates to get the rise (y₂ − y₁), subtract the x-coordinates to get the run (x₂ − x₁), then divide rise by run: m = (y₂ − y₁) / (x₂ − x₁). The order of the points does not matter — swapping both pairs flips both signs and leaves the slope unchanged.

What does a negative slope mean?

A negative slope means the line falls as you move from left to right. Examples include a descending road, a depreciating asset's value over time, or a cooling curve. A slope of −1 is a 45° downward angle.

What is the difference between slope and angle?

Slope is a ratio of vertical change to horizontal change (rise over run). Angle is the physical tilt of the line measured in degrees. They are related by tangent: angle = atan(m). A slope of 1 equals 45°, a slope of 0.5 equals about 26.6°, and a slope of 10 equals about 84.3° — notice how quickly large slopes approach the vertical 90°.

What is a 6% grade in slope?

A road grade of 6% means the rise divided by the run equals 0.06. So the slope is 0.06, which is an angle of about 3.43°. Grades are expressed as a percent so drivers can read them on highway signs; truck routes often cap grades around 6–8%.

Why is a vertical line's slope undefined?

For a vertical line, both points have the same x coordinate, so the run (x₂ − x₁) is zero. Dividing by zero is not defined in mathematics, so the slope does not exist. A horizontal line, by contrast, has a slope of exactly zero — do not confuse the two.

How do I find the y-intercept from the slope?

Once you have the slope m, plug in either point: b = y₁ − m·x₁. Then the line is y = m·x + b. The x-intercept is −b / m, found by setting y = 0 and solving for x.

Can the slope be a fraction or a decimal?

Yes. Slope can be any real number — an integer like 3, a fraction like 2/3, a decimal like 0.25, or a negative number like −1.75. The calculator accepts decimals directly and reports the exact numeric value.

Disclaimer

This slope calculator is provided for informational purposes only and does not constitute engineering, surveying, or other professional advice. Results are computed directly from the coordinates you enter using the standard two-point slope formula; always verify critical measurements against official drawings, survey data, or a qualified professional before relying on them in construction, design, or safety-critical work.

Related Calculators

Disclaimer

Results are estimates for illustration only. Verify important figures independently.