1. Home
  2. Calculators
  3. Slope Calculator

Slope Calculator

For students and builders who need the slope or the equation of a line through two points.

Free, no sign-up. Runs in your browser: nothing is uploaded.

Free workspace included. Docs, spreadsheets, notes and tasks that save on your device. No sign-up.Take a look

How to use Slope Calculator

  1. Enter your numbers, or press a sample to see an example.
  2. Read the results and the table under them.
  3. Copy the results or download the table.

Features

  • Slope as rise over run, and as a percent grade
  • Slope-intercept, point-slope and standard form
  • Distance, midpoint and angle of inclination
  • x and y intercepts
  • Plot of the line

Supported formats

Input

  • Typed coordinates

You get

  • On-screen results
  • Plot (SVG and PNG)
  • Copyable text

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Slope Calculator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • It needs two different points; a vertical line has no slope but is still given its equation.
  • The plot is a sketch scaled to fit, not a precise graph.
  • Everything runs in your browser; nothing you type is sent anywhere.

Guide

Slope and the equation of a line from two points, with intercepts, distance and angle

The slope of a line says how steeply it rises or falls: the change in height for each step across. Roads, roofs, ramps and graphs all have one. Given two points, this calculator finds the slope and writes the line’s equation in three forms, then adds the distance, midpoint, angle and intercepts, and draws the line so you can see whether the answer looks right.

How it works

With points (x1, y1) and (x2, y2), the rise is y2 − y1 and the run is x2 − x1. The slope m is rise divided by run. The y-intercept b follows from y1 = m × x1 + b, and the line is y = mx + b. The point-slope form, y − y1 = m(x − x1), keeps the first point visible. Standard form, Ax + By = C, is built from the rise and run and then reduced by their common factor and given a positive first coefficient, so 6x − 2y = 2 is shown as 3x − y = 1.

What else is reported

The distance between the points comes from the Pythagorean theorem and the midpoint is the average of the coordinates. The angle of inclination is the angle the line makes with the positive x axis, from 0 to 180 degrees. The x- and y-intercepts show where the line crosses the axes, and the percent grade is the slope times 100, the form used for roads and ramps. The page also gives the slope of a parallel line, which is the same, and of a perpendicular line, which is the negative reciprocal.

Vertical and horizontal lines

When x1 equals x2 the run is zero, so the slope is not defined. The page states that, gives the equation as x equals that value, reports an angle of 90 degrees and shows no y-intercept. A horizontal line has a slope of 0, an equation y = a constant, and no x-intercept. If you enter the same point twice, the page explains that two identical points do not define a line.

Edge cases

Coordinates can be negative, decimal or large. A downward line has a negative slope and an angle over 90 degrees. When the slope is not a whole number, the results are shown with up to ten digits. The parallel line has the same slope and the perpendicular line is the negative reciprocal, which does not exist when the original slope is zero.

A worked example

For (1, 2) and (3, 8) the rise is 6 and the run is 2, so the slope is 3. The distance is 6.32455532, the midpoint is (2, 5) and the angle is 71.565051°. The line is y = 3x − 1, written as y − 2 = 3(x − 1) in point-slope form and 3x − y = 1 in standard form, with a y-intercept of −1 and an x-intercept of 0.3333333333. The percent grade is 300%. A road that rises 3 m over 50 m has slope 0.06, a grade of 6%, an angle of 3.4336304° and a length along the slope of 50.08991915 m. The points (−2, 4) and (4, −2) give a slope of −1, an angle of 135° and the line y = −x + 2.

Limits

Only two points are used. For a best-fit line through many points, use regression. The plot is a sketch scaled to fit the page, with no gridlines for measurement, and it is not intended for printing a precise graph. Slopes from map contours or real terrain need the true horizontal and vertical distances in the same unit before you enter them.

Checked against the current version of the Slope Calculator on .

Frequently asked questions

What do parallel and perpendicular slopes mean?

A line parallel to yours has the same slope, and a perpendicular line has the negative reciprocal. For a slope of 3 the perpendicular slope is minus one third, about −0.3333333333.

Why is the angle 135 degrees for a slope of −1 and not −45?

The page reports the angle of inclination of the line from the positive x axis, which runs from 0 to 180 degrees. A falling line therefore has an angle above 90, and the direction of travel from left to right is 45 degrees downward.

What is the slope between (1, 2) and (3, 8)?

Rise 6 over run 2 is 3. The line is y = 3x − 1, or 3x − y = 1 in standard form.

What happens with a vertical line?

If both points have the same x value the run is zero, so the slope is not defined and the equation is x = a constant.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.