U

Slope Calculator

Find the slope, rise, run and y-intercept of a line from two points. Instant results for ramps, roofs, roads and graph lines.
Input Details
1
01000
2
01000
7
01000
6
01000

Line Slope

Breakdown

y-Intercept (b)
0
Rise (Δy)
0
Run (Δx)
0

Key Assumptions

  • Slope is calculated as (y₂ − y₁) / (x₂ − x₁) for any two points on the line; the result is dimensionless.
  • When the two points share the same x-coordinate the line is vertical: its slope is undefined, so the calculator shows 0 and the y-intercept is reported as 0.
  • A horizontal line (y₁ = y₂) has a slope of exactly 0 and its y-intercept equals the common y-value.
  • The y-intercept assumes the line continues straight, following the slope, all the way to x = 0. Sliders are limited to non-negative coordinates.

Formula Used

Slope: m = (y₂ − y₁) / (x₂ − x₁) Rise: Δy = y₂ − y₁ Run: Δx = x₂ − x₁ y-Intercept: b = y₁ − m × x₁ Vertical line (x₁ = x₂): slope is undefined → shown as 0
Embed this calculator on your website

Add this embed page to your site — visitors use the calculator right from your page.

Slope is one of the most useful numbers in mathematics. It tells you how steep a line is, whether it rises or falls, and how quickly one value changes with another. The Slope Calculator finds the slope of any straight line from just two points, together with the rise, the run and the y-intercept, so you can describe the line completely — its steepness, its direction and its position — without doing any of the arithmetic by hand.

What Is Slope?

Slope measures the steepness and direction of a line. It answers a simple question: as you move one unit to the right, how many units does the line go up or down? If a line climbs two units for every unit it moves right, its slope is 2. If it descends one unit per unit of horizontal movement, its slope is −0.5. A perfectly horizontal line never rises or falls, so its slope is exactly 0. Mathematically, slope is the ratio of the vertical change to the horizontal change between two points on the line, commonly written as the letter m. Because a straight line has the same steepness everywhere, you can pick any two points on it and compute the same value.

How to Use This Calculator

Using the tool takes a few seconds. Choose the x-coordinate and the y-coordinate of a first point, then the x-coordinate and the y-coordinate of a second point, using the four sliders. The calculator instantly shows four results: the slope, the y-intercept, the rise and the run. As an example, set the first point to (1, 2) and the second point to (7, 6): the rise is 4, the run is 6, and the slope is 4 divided by 6, about 0.67. The y-intercept works out to roughly 1.33, meaning the line crosses the y-axis just above the origin and follows the equation y = 0.67x + 1.33. Try moving the sliders and watch how a nearly horizontal line produces a tiny slope while an almost vertical line produces a very large one.

The Slope Formula

Everything in this calculator comes from one formula. Given two points (x₁, y₁) and (x₂, y₂), the slope is m = (y₂ − y₁) / (x₂ − x₁). The top of the fraction, y₂ − y₁, is the rise: the vertical difference between the points. The bottom, x₂ − x₁, is the run, the horizontal difference. Dividing rise by run converts the change into a rate per unit. The formula works no matter which two points on the line you choose, and it does not matter which point you label first, as long as you subtract both coordinates in the same order. Swapping the two points entirely gives the same answer, while subtracting in opposite orders flips the sign of the result.

Positive, Negative and Zero Slope

The sign of the slope reveals the direction of the line. A positive slope means the line rises as it moves from left to right, like a road climbing a hill on a chart. A negative slope means the line descends from left to right, like a chart of falling prices. A slope of exactly 0 means the line is horizontal, changing height never at all. The magnitude tells you the steepness: a slope of 10 is a nearly vertical line, while a slope of 0.02 is a gentle, almost flat glide. Reading signs and magnitudes is the everyday skill: an upward-sloping trend line in a report is positive, a downward one is negative, and a flat period is zero slope.

The Vertical Line Exception

One kind of line defeats the slope formula. Every point on a vertical line shares the same x-coordinate, so the run, the bottom of the slope fraction, is always zero. Dividing by zero has no mathematical meaning, so a vertical line has no defined slope, often described as undefined or infinite. This calculator handles the case gracefully: when both points share the same x-value, the run output shows 0 and the slope is shown as 0 rather than an error or an unusable infinity. The y-intercept also loses its meaning for a vertical line, because such a line never actually crosses the y-axis, so that output shows 0 as well. This is a genuine property of slope, not a quirk: a vertical barrier simply cannot be described by a finite steepness number.

Rise and Run

The two ingredients of the slope are useful on their own, so the calculator shows them separately. The rise is the vertical difference y₂ − y₁, and the run is the horizontal difference x₂ − x₁. Remembering slope as rise over run is a helpful habit: a slope of 1/4 means a gentle climb of one unit for every four units across, while 4/1 means a nearly wall-like ascent. When the rise is negative, the line trips downward; when the run is negative, the movement happens above the first point, but the ratio captures the overall direction. Builders and surveyors often measure the rise and run directly with a level and a tape before any division happens, then feed the two numbers into the same slope arithmetic this calculator performs.

Slope-Intercept Form and the Y-Intercept

Two numbers describe a straight line completely: its steepness and its position. The equation y = mx + b packages both, with m the slope and b the y-intercept, the height at which the line meets the y-axis where x = 0. The calculator derives b from either point by rearranging the equation: b = y₁ − m·x₁. For the points (1, 2) and (7, 6), the slope is 0.67, so b comes out to 2 − 0.67 × 1, about 1.33. With m and b, you can predict the y-value at any x, sketch the line, or compare two lines at a glance. This is the most common first new skill in algebra coursework, and the calculator performs the arithmetic instantly and shows the intercept alongside the slope.

Slope as Grade and Angle

Engineers say the same steepness in different units. Slope percentage is the slope multiplied by 100: a slope of 0.1 is a 10% grade, matching the familiar warning sign on highways. Because the tangent of the line's angle equals the slope, the angle is the arctangent of the slope converted from radians to degrees. The table below lets you move between the three ways of expressing steepness.

SlopeGradeTypical example
00%Level floor or pavement
0.0838.3%Wheelchair ramp guideline (1 in 12)
0.110%Steep driveway
0.57757.7%30° roof pitch
1100%45° slope, limit for most climbs
VerticalNoneUndefined steepness, a wall

Negative slopes carry the same translations on the downhill side of zero. A drain pipe at slope −0.02 drops 2 units for every 100 of length, which is why plumbing call it a 2 per hundred fall. Whatever field you are in, knowing the slope unlocks the angle, the grade and the fall rate without any extra work.

Real-World Uses of Slope

Slopes are everywhere once you start looking. Wheelchair and accessibility ramps in most building codes stay at or under 1 in 12, which is a slope of about 0.083, the difference between a compliant entrance and an unusable one. Roofs are sold by their pitch, traditionally 4 in 12 or 6 in 12, which are nothing more than slopes of 0.333 and 0.5. Roads carry grade signs in expressed percentages. Drainage pipes rely on a minimum fall so water moves and solids wash away. Staircases are designed around the rise and run of each step, typically around 0.6 to 0.7. Checking any of these reduces to the same job the calculator does: measure two points, find the rise over the run, and read the slope.

Slope and Distance Are Different Things

Slope is easily confused with distance, but they answer different questions. The slope is a ratio, the rise divided by the run. The distance of the connecting segment is the length that matches the incline, found from the same two components with the Pythagorean theorem: the square root of rise squared plus run squared. A slope of 0.2 with a rise of 100 over a run of 500 describes a surface about 510 units long along its face. One tells you how steep, the other how long. The related tools handle those other numbers: the Distance Calculator computes the straight-line length between the points, and the Pythagorean Theorem Calculator does the same square-root work for right triangles.

Parallel and Perpendicular Lines

Slope also decides how lines relate to each other. Parallel lines keep the same steepness forever and never meet, so their slopes are equal. Perpendicular lines meet at a right angle, and their slopes multiply to −1: one line at slope 2 meets a line at slope −1/2 at 90 degrees. Inside any perpendicular pair one slope is the negative reciprocal of the other. The vertical exception appears here too — a vertical line is perpendicular to every horizontal line even though it has no defined slope of its own. These simple rules run foundation layouts, tiles checking grid walls, and carpenters squaring frames, always reduced to comparing two slope numbers.

Common Mistakes

  • Subtracting coordinates in different orders — the sign flips with the ordering error; keep y₂ paired with x₂.
  • Calling a horizontal line slopeless — its slope is exactly 0, a defined, useful value.
  • Equating slope with distance — slope is a ratio, distance is a length measured along the inclined segment.
  • Forgetting the vertical line — divided by zero is undefined; here it is reported as 0 with a visible zero run.
  • Reading magnitude only — the sign carries the direction information that decides whether drains drain and roofs shed.

Key Assumptions

  • The two points are taken from a single straight line; the slope describes the whole line and all its segments.
  • Coordinates are non-negative values up to 1000, typical of diagram problems, maps and small layouts.
  • When the run is zero the line is vertical: slope and y-intercept are both reported as 0 and the zero run output explains why.
  • The y-intercept is a projected value, found by continuing the straight line to the y-axis — it is not a separately measured point.
  • The slope itself has no unit; the grade percentages and angle conversions in the table are included purely for interpretation.

Two points give you the whole line: its steepness, the direction it leans, and the point where it crosses the y-axis. Whether the task is homework, a ramp design, a roof estimate or just reading a road sign, the Slope Calculator performs the division and returns the rise, run, slope and intercept that describe the line completely.

FAQs

Related Calculators