Slope Calculator screenshot

Slope Calculator

Compute the slope between two points as an exact fraction and a decimal, with its angle, the y-intercept and the vertical case named.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
No sign-up, no upload
Exact fraction printed

Slope Calculator

Compute the slope between two points as an exact fraction and a decimal, with its angle, the y-intercept and the vertical case named.

How this page computes

The rise and run are the coordinate differences. The slope is rise over run, reduced to lowest terms for the fraction, and the y-intercept follows from one point.

The angle uses the arctangent of the slope and, separately, the two-argument arctangent of the differences, which keeps the direction. A zero run switches the output to the vertical case.

The calculation runs entirely in this browser tab; nothing is uploaded.

The slope between (1, 2) and (4, 8) is 6 over 3, which is 2. The page prints it as a fraction and as a decimal, because the fraction is exact and the decimal is what a graph reads.

A vertical segment has no slope, since the run is zero. The page names that case and prints the line as x = constant instead of writing infinity where a number belongs.

How to use Slope Calculator

Enter both points and press Run. The page computes the rise, the run, the slope, the angle above the x-axis, the y-intercept and whether the line rises or falls.

If the x coordinates are equal the output switches to the vertical case: no slope, no y-intercept, and the constant x value the line sits at.

Why the angle and the slope are both printed

The slope is the rise divided by the run, which is the tangent of the angle the line makes with the x-axis. So the angle is the arctangent of the slope, and the page prints both because a slope of 1 means less to most readers than 45 degrees.

The arctangent only returns angles between −90 and 90 degrees, so the page also computes the angle from the coordinate differences directly. That version distinguishes a line pointing up and to the right from one pointing down and to the left.

What to Expect

Best for

  • The slope between two points
  • The angle a line makes with the x-axis
  • The y-intercept implied by a point and a slope

Not ideal for

  • The equation of the line, which has its own page
  • A vertical segment, where no slope exists
  • A curve's slope at a point, which needs a derivative

What this tool keeps

  • All four coordinates exactly as typed

What may need cleanup

  • Nothing: the slope and the intercept are final

Common errors

  • Identical points are refused
  • A vertical segment is answered as a vertical line rather than with infinity

Example use cases

  • Find the slope through (1, 2) and (4, 8)
  • Get the angle of a line with slope 1
  • See a vertical segment reported as x = 2

Sample input

(1, 2) and (4, 8)

Sample output

rise 6, run 3, slope 2, angle 63.434949 degrees

Who this is for

  • Students meeting linear graphs
  • Readers measuring a gradient

Frequently asked questions

Why is the slope printed as a fraction?

Because the fraction is exact. 6 over 3 reduces to 2, and a slope like 1 over 3 cannot be written as a finite decimal, so the fraction is the only exact form.

What is the slope of a vertical line?

It has none. Slope is rise over run and the run is zero, so the ratio does not exist. The page prints the line as x = constant, which is the honest description.

Which angle is printed?

The angle measured from the positive x-axis, taken from the coordinate differences, with the inverse tangent printed beside it. They agree for a line rising to the right and differ in sign for one falling to the left.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.