CalcTray

Slope Calculator

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

Point 1
Point 2

Embed this calculator

Add it to your website or blog

Embed this calculator

Paste this code into your website's HTML.

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.

Further Reading

Related Calculators