Skip to main content

Slope Calculator

Find the slope between two points (x₁, y₁) and (x₂, y₂), the line's slope-intercept equation, its angle of inclination, and the distance between the points — with vertical and horizontal lines called out explicitly.

Input

x-coordinate of the first point.

y-coordinate of the first point.

x-coordinate of the second point.

y-coordinate of the second point.

Output

Step-by-Step Solution
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/slope-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "x1": "2",
    "y1": "3",
    "x2": "6",
    "y2": "11"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `slope-calculator` tool (Slope Calculator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/slope-calculator/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Slope Calculator — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

The Slope Calculator finds the slope of the line through two points (x₁, y₁) and (x₂, y₂) — the most common "rise over run" question — along with the line's slope-intercept equation, its angle of inclination, and the straight-line distance between the two points.

It's built for students checking homework, anyone plotting a line from two known coordinates, and for a quick sanity check before feeding a slope into another calculation.

How to use it

  1. Enter the coordinates of Point 1 (x₁, y₁) and Point 2 (x₂, y₂).
  2. Read the Slope (m) result — a plain number, or "Undefined (vertical line)" / "0 (horizontal line)" for the two special cases.
  3. Check Line Equation, Angle of Inclination, and Distance Between Points for the rest of the picture.
  4. Open Step-by-Step Solution to see exactly how each value was derived.

Results update automatically as you type. For example, (2, 3) and (6, 11) gives a slope of 2, the equation y = 2x - 1, and an angle of 63.4349°.

The slope formula

Given two points, the slope is m = (y₂ − y₁) / (x₂ − x₁) — how much y changes for each unit change in x. A positive slope rises left to right; a negative slope falls.

Vertical and horizontal lines

If both points share the same x-coordinate (x₁ = x₂), the line is vertical: the run is zero, so the slope is mathematically undefined, and there's no y = mx + b form — the calculator reports x = <value> instead and an angle of inclination of 90°. If both points share the same y-coordinate (y₁ = y₂), the line is horizontal: the slope is exactly 0, the equation reduces to y = <value>, and the angle of inclination is .

What is angle of inclination?

The angle of inclination is how far the line tilts from horizontal, computed as arctan(m) in degrees. It ranges from (flat) up to just under 90° for a very steep line, jumping to exactly 90° for a vertical line.

FAQ

How is this different from the Slope-Intercept Form Calculator?

This tool is the plain "two points in, slope out" case. The Slope-Intercept Form Calculator goes further — it also derives the standard form and x-intercept, and can start from a slope and y-intercept directly instead of two points.

I already know one point and the slope — not two points

Use the Point-Slope Form Calculator instead, which builds a line's equation from a single point and a known slope.

Privacy

This calculator runs entirely in your browser. Your numbers are never uploaded, logged, or stored — the computation happens locally on your device.

rise over rungradientline equationtwo pointscoordinate geometryangle of inclinationdistance between pointsalgebramath

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.