CalcCards

Slope Calculator: Find Slope, Midpoint, and Distance Between Two Points

Updated Apr 10, 2026

Slope Calculator

Results

Slope (m)2.0000
Equationy = 2.00x + 0.00
Distance8.9443
Y-Intercept (b)0.0000
View saved →

Embed

Add this to your site

<iframe
  src="https://calc.cards/embed/math/slope-calculator"
  width="600"
  height="700"
  frameborder="0"
  loading="lazy"
  title="Calc.Cards calculator"
  style="border:1px solid #e0e0e0;border-radius:8px;max-width:100%;"
></iframe>

Free with attribution. The Slope Calculator runs entirely inside the iframe.

Branded

Customize & brand for your site

Get the Slope Calculator as a self-contained widget styled with your colors and logo. No iframe, no Calc.Cards branding.

  • Brand color palette (auto-extract from your URL)
  • Your logo, your typography
  • Clean HTML/CSS/JS you can drop on any page
  • Lifetime updates if the formula changes
Brand this calculator — $199

Need something different? Build a fully custom calc

You Have Two Points on a Graph and Need to Know the Slope-And the Midpoint, and the Distance

Slope measures how steeply a line rises or falls. It's fundamental to linear equations, graphing, and understanding rates of change. But calculating slope by hand requires finding the change in y, the change in x, and then dividing-and if you also need the midpoint or distance between points, that's more arithmetic. A slope calculator handles all three in one go, showing the step-by-step arithmetic so you understand the process.

What This Calculator Does

The slope calculator takes two coordinate points (x₁, y₁) and (x₂, y₂) and returns the slope of the line connecting them. It also calculates the midpoint (the point exactly halfway between the two) and the distance (the straight-line distance between them). You see the formulas applied to your specific coordinates, the intermediate steps, and the final numerical results. For non-integer results, the calculator provides both exact fractions and decimal approximations.

How to Use This Calculator

Enter the coordinates of your first point: x₁ and y₁. Enter the coordinates of your second point: x₂ and y₂. Hit calculate. The calculator displays the slope, midpoint, and distance, with all work shown step-by-step.

Example: Point 1 is (1, 2), Point 2 is (4, 8). The slope is (8-2)/(4-1) = 6/3 = 2. The midpoint is ((1+4)/2, (2+8)/2) = (2.5, 5). The distance is √((4-1)² + (8-2)²) = √(9 + 36) = √45 ≈ 6.71.

The Formula Behind the Math

Slope: The slope (m) measures the steepness of a line, calculated as the rise over run:

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

Example: (3, 1) and (7, 5)

Rise = 5 - 1 = 4
Run = 7 - 3 = 4
Slope = 4/4 = 1

A slope of 1 means for every 1 unit you move right, you move 1 unit up.

Slope interpretation:

Positive slope: Line rises left to right
Negative slope: Line falls left to right
Zero slope: Horizontal line
Undefined slope: Vertical line (denominator is zero)

Midpoint: The point exactly halfway between two points:

Midpoint = ((x₁ + x₂) / 2, (y₁ + y₂) / 2)

Example: (1, 3) and (5, 7)

x-midpoint = (1 + 5) / 2 = 3
y-midpoint = (3 + 7) / 2 = 5
Midpoint = (3, 5)

Distance: The straight-line distance between two points (derived from the Pythagorean theorem):

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

Example: (0, 0) and (3, 4)

Δx = 3 - 0 = 3
Δy = 4 - 0 = 4
Distance = √(3² + 4²) = √(9 + 16) = √25 = 5

This is the famous 3-4-5 right triangle.

Our calculator does all of this instantly-but now you understand exactly what it's computing. Slope, midpoint, and distance are the three most fundamental calculations for coordinate geometry.

Real Example: Road Grade and Elevation

A road climbs from an elevation of 1,200 feet at one point to 1,500 feet at a point 3 miles (15,840 feet) away horizontally. What's the grade (slope)?

Points: (0, 1200) and (15840, 1500)

Slope = (1500 - 1200) / (15840 - 0) = 300 / 15840 ≈ 0.0189

As a percentage: 0.0189 × 100 = 1.89% grade. Steep mountain roads might be 10-15%; a 1.89% grade is gentle but noticeable.

Real Estate and Property Boundaries

A property boundary runs from point (100, 200) to point (400, 500) on a site plan. What's the slope of the boundary line?

Slope = (500 - 200) / (400 - 100) = 300 / 300 = 1

A slope of 1 means the boundary rises at a 45-degree angle. The midpoint is ((100+400)/2, (200+500)/2) = (250, 350). The distance is √((300)² + (300)²) = √180000 ≈ 424.26 units (likely feet or meters depending on the site plan).

Navigation and Map Coordinates

You're at latitude/longitude coordinates (40.7128, -74.0060) (New York City), and you want to measure distance to coordinates (34.0522, -118.2437) (Los Angeles) on a simplified flat map. Using the distance formula:

Distance = √((34.0522 - 40.7128)² + (-118.2437 - (-74.0060))²)

= √((-6.6606)² + (-44.2377)²)

= √(44.36 + 1957.00)

= √2001.36 ≈ 44.74 degrees

This is a rough approximation because the Earth is spherical, but on a flat map projection, this calculation applies.

Tips and Things to Watch Out For

Slope is undefined for vertical lines. If x₁ = x₂, the denominator is zero, and slope is undefined. Vertical lines don't have a finite slope; they're said to have "infinite" or "undefined" slope.

A slope of 0 is valid. Horizontal lines have slope 0 (rise is zero, run is nonzero). This is different from undefined slope.

Slope is order-independent (for magnitude). The slope from (1, 2) to (4, 5) is the same as from (4, 5) to (1, 2), because both numerator and denominator flip signs. The formula is symmetric in that sense.

Distance is always positive. The distance formula squares differences, so negative values vanish. Distance is a magnitude, always ≥ 0.

Midpoint always lies between the two points. This is geometrically obvious but mathematically guaranteed by the averaging formula. If you calculate a midpoint outside the two points, something's wrong.

Frequently Asked Questions

What's the slope-intercept form of a line?

It's y = mx + b, where m is the slope (what this calculator finds) and b is the y-intercept (where the line crosses the y-axis). Once you have the slope and one point, you can find b and write the full equation.

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

First, calculate the slope using this calculator. Then use the point-slope form: y - y₁ = m(x - x₁). Plug in your slope and one of your points, and you have the equation.

What if both points are the same?

The slope is undefined (0/0). The midpoint is just that point. The distance is zero. This is a degenerate case that doesn't define a line.

Can I have negative coordinates?

Yes, absolutely. The formulas work perfectly with negative x and y values. Points in different quadrants of the coordinate plane are handled fine.

How do I interpret a slope of -2?

It means for every 1 unit you move right, you move 2 units down. The line falls steeply (more steeply than a slope of -1). Negative slopes indicate inverse relationships: as x increases, y decreases.

What's the difference between slope and distance?

Slope is a ratio (rise over run), describing the steepness and direction of a line. Distance is the length of the straight-line path between two points, measured in whatever units the coordinates use.

Related Calculators

The Pythagorean theorem calculator is the geometric foundation of the distance formula. The quadratic formula calculator helps you find intersection points of lines and parabolas. The triangle calculator uses midpoint and distance concepts to analyze triangular shapes on a coordinate plane.

Related Calculators