Slope Calculator

Enter two coordinate points to find the slope of a line and related properties

By Drew Budwin · Last updated July 2026 · Methodology

Point 1
Point 2

Embed this calculator

Add it to your website or blog

Embed this calculator

Theme

Paste this code into your website's HTML where you want the calculator to appear. It adds a small credit link back to CalcTray. Please keep it. How embedding works.

Optional: auto-resize iframe to fit content

Add this snippet to your page so the iframe height adjusts automatically after each calculation:

Slope Calculator Formula

The slope of a line through two points is calculated as rise over run:

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

m is the slope, (x₁, y₁) and (x₂, y₂) are the two coordinate points.

The Euclidean distance between two points is:

d = √((x₂ - x₁)² + (y₂ - y₁)²)

d is the distance, (x₁, y₁) and (x₂, y₂) are the two coordinate points.

The slope-intercept form of a line is:

y = mx + b

m is the slope, b is the y-intercept.

How to Use This Calculator

  1. Enter the coordinates for Point 1 (x₁, y₁).
  2. Enter the coordinates for Point 2 (x₂, y₂).
  3. Click Calculate to compute the slope and related properties.
  4. View results including slope, rise, run, angle, intercepts, distance, and the line equation.
  5. Share your calculation by copying the URL. It encodes your inputs.

Frequently Asked Questions

What is the slope of a line?

The slope of a line measures its steepness and direction. It is calculated as the ratio of the vertical change (rise) to the horizontal change (run) between any two points on the line. A positive slope means the line goes upward from left to right; a negative slope means it goes downward. The distance between the two points is found using the Pythagorean theorem.

What does an undefined slope mean?

An undefined slope occurs when the line is perfectly vertical (x₁ = x₂). In this case, the run is zero, and dividing by zero is undefined. Vertical lines are written as x = k, where k is the x-coordinate.

How do I find the equation of a line from two points?

First, calculate the slope m = (y₂ - y₁) / (x₂ - x₁). Then find the y-intercept b = y₁ - m × x₁. The equation in slope-intercept form is y = mx + b. This calculator does all of that for you.

What is the angle of a line?

The angle of a line is the angle it makes with the positive x-axis, measured in degrees. A horizontal line has an angle of 0 degrees, a line going upward to the right has an angle between 0 and 90 degrees, and a line going downward to the right has an angle between 90 and 180 degrees.

Can I use negative numbers for coordinates?

Yes, this calculator accepts any real number (positive, negative, or zero) for all four coordinate values. Points can be in any quadrant of the coordinate plane.

What is the distance between two points?

The distance formula is d = sqrt((x₂ - x₁)² + (y₂ - y₁)²), which is derived from the Pythagorean theorem. This calculator shows the distance alongside the slope and equation.

What is the difference between slope and grade (gradient)?

Slope is expressed as a ratio (rise/run) or in y = mx + b form. Grade is the same ratio expressed as a percentage: grade = (rise/run) × 100. A slope of 0.05 is a 5% grade — standard for highway on-ramps. Residential driveways typically run 10%–15%.

What does a slope of zero mean?

A slope of zero means a perfectly horizontal line. There is no vertical change regardless of horizontal distance. The y-intercept is the only y-value on the line.

How do I use slope to check if two lines are parallel or perpendicular?

Parallel lines have equal slopes. Perpendicular lines have slopes that are negative reciprocals: if one slope is m, the other is −1/m. A line with slope 2 is perpendicular to a line with slope −0.5. Enter each line's coordinates here separately to compare their slopes.

Further Reading

Related Calculators