Slope calculator

Everything a straight line through two points can tell you, in one place.

Slope
2
≈ Rounded Slope and line
y-intercept
-1
Distance between the points
13.416 407 865
Angle from horizontal
63.434 95 degrees
Midpoint x
5
Midpoint y
9
Perpendicular slope
-0.5
As a percentage grade
200.0000 %
Show the working
  1. x1 = 2
  2. y1 = 3
  3. x2 = 8
  4. y2 = 15
  5. dx = 8 - 2 = 6
  6. dy = 15 - 3 = 12
  7. Slope = 6 != 0 ? 12 / 6 : 0 = 2
  8. y-intercept = 3 - 2 * 2 = -1
  9. Distance between the points = hypot(6, 12) = 13.4164
  10. Angle from horizontal = deg(atan2(12, 6)) = 63.4349
  11. Midpoint x = (2 + 8) / 2 = 5
  12. Midpoint y = (3 + 15) / 2 = 9
  13. Perpendicular slope = 2 != 0 ? -1/2 : 0 = -0.5
  14. As a percentage grade = 2 * 100 = 200

Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.

Scenarios & local history

Compare a saved scenario

Recent calculations

    The formula

    • slope m = (y2 - y1) / (x2 - x1)
    • y = mx + b with b = y1 - m x1
    • distance = sqrt(dx^2 + dy^2)

    Related calculators

    Settings

    Theme

    System follows your operating system and changes with it.

    Text size
    High contrast

    Maximises text and border contrast and removes the grid background.

    Graph-paper background

    Round to
    Notation
    Thousands separators
    Decimal mark
    Nearest fraction

    Shows the result as the nearest tape-measure fraction, with the error it costs.


    Accessibility & interaction
    Reduce motion Stops interface animations even when the operating system does not.
    Underline links Keeps links visually distinct without relying on colour.
    Larger touch targets Makes buttons and form controls easier to tap.
    Shorter reading lines Limits article width for easier scanning.
    Monochrome display Removes colour as an information cue.
    Always-visible focus Makes the keyboard focus ring persistent and stronger.
    Verbose screen-reader results Announces the complete conversion equation.
    Sticky action bars Keeps converter and calculator actions within reach.
    Select values on focus Replaces a value immediately when you start typing.
    Left-handed mobile layout Moves key mobile actions toward the left thumb.

    Your data

    Settings, recent conversions and favourites live in this browser only. Nothing is sent anywhere.

    Offline library