Slope Calculator
Enter two coordinates to calculate the slope, line equation, slope angle, midpoint, distance, rise, and run in one place.
Slope Calculator
Enter Point A (x1, y1) and Point B (x2, y2) to see the slope m, line equation, slope angle, midpoint, distance, rise, and run on one screen.
Using coordinates from the same unit system makes the slope and line equation easier to interpret. If Point A and Point B are identical, a single line cannot be determined.
Use the presets to switch both points and the result card at the same time so you can compare line types quickly.
- If x2 – x1 is 0, the result is a vertical line and the slope formula has a zero denominator.
- If y2 – y1 is 0, the result is a horizontal line with slope 0 and the equation takes the form y = constant.
- Negative coordinates and decimals are both supported.
- Use the copy button in the top result card to grab the key values and line equation as plain text.
Once the two points are different, the slope and line equation can be calculated.
Point A (1, 2) and Point B (5, 10) form a rising line where y increases by 2 for every increase of 1 in x. The y-intercept is 0 and the angle is about 63.43°.
From Point A to Point B, x changes by 4 and y changes by 8. The dashed guides split the horizontal run from the vertical rise.
| Point A | (1, 2) |
|---|---|
| Point B | (5, 10) |
| Midpoint M | (3, 6) |
| Distance between the points | 8.94 |
| Slope angle | 63.43° |
| Intercept details | y-intercept b = 0 |
| Line type | Rising line |
- Δx = 5 – 1 = 4, Δy = 10 – 2 = 8
- m = Δy ÷ Δx = 8 ÷ 4 = 2
- b = y1 – m×x1 = 2 – 2×1 = 0 → y = 2x
- Midpoint M = ((1 + 5) ÷ 2, (2 + 10) ÷ 2) = (3, 6)
- Distance = √(4² + 8²) = 8.94, angle = arctan(2) ≈ 63.43°
What is a slope calculator?
The slope calculator is a coordinate-geometry tool that helps you read the direction and steepness of a line from two points. Enter Point A (x1, y1) and Point B (x2, y2), and the tool applies m = (y2 - y1) / (x2 - x1) to compute the slope m, the line equation, the slope angle, the midpoint, and the distance between the points.
It works for classroom math, graph reading, quick grade checks, and sketch-level planning where you need to understand how much a line rises or falls between two coordinates. Instead of returning a single number, the tool also shows the rise, run, line type, and a visual preview so the result is easier to interpret.
When this tool is useful
Slope is a core topic in coordinate geometry, but it also appears in trend lines, grade checks, line-equation problems, and quick distance comparisons. If you already know two points and want to see how steep the line is, which way it moves, and what equation describes it, this calculator gives you that answer in one pass. If you want to normalize ratios before working with coordinates, pair it with the Proportion Calculator.
- Checking slope and line-equation homework in middle school or high school math
- Reading how a graph rises or falls between two measured points
- Estimating grades, ramps, or height differences from coordinate data
- Finding the line equation and midpoint for two known coordinates
- Comparing vertical, horizontal, rising, and falling lines side by side
Main features
This calculator is designed to show more than the slope alone. The top result card highlights the most important interpretation first, while the sections below summarize the line equation, percent grade, midpoint, distance, coordinate preview, and step-by-step formulas so you can understand the line at a glance.
- Two-point slope calculation – Enter x1, y1, x2, and y2 to compute slope m
- Automatic line equations – Shows both slope-intercept form and point-slope form
- Slope angle and grade – Interprets the line in degrees and percent grade
- Midpoint and distance – Adds the center point and point-to-point distance
- Coordinate preview – Visualizes both points, the segment, the rise, and the run
- Vertical and horizontal edge cases – Explains undefined slope and zero slope separately
- Copy-ready output – Lets you copy the key values and equations as plain text
How to use it
The workflow is simple. Enter the coordinates of Point A and Point B, choose the display precision you want, and press Calculate. The slope, line equation, midpoint, distance, angle, and preview update together. The quick examples also make it easy to compare vertical, horizontal, rising, and falling lines.
- Enter Point A – Fill in x1 and y1.
- Enter Point B – Fill in x2 and y2.
- Choose decimal places – Set the precision you want on screen.
- Press Calculate – The key results update in one step.
- Review the preview – Compare the rise and run visually.
- Copy if needed – Use the copy button for notes, homework, or reports.
How slope formulas work
The core formula is m = (y2 - y1) / (x2 - x1). In other words, slope measures how much y changes compared with how much x changes between two points. If y goes up by 2 whenever x goes up by 1, the slope is 2. If y drops by 0.5 whenever x goes up by 1, the slope is -0.5.
When x2 - x1 = 0, the denominator becomes zero, so the slope is undefined in ordinary real-number arithmetic. That is a vertical line, and the equation is written as x = constant. When y2 - y1 = 0, the slope is 0 and the result is a horizontal line with the form y = constant.
After you know the slope, you can rewrite the line as y = mx + b. The value b is the y-intercept, and you can compute it with b = y1 - m×x1. If you also want to compare the rise and run as a triangle, the Right Triangle Calculator is a useful follow-up.
- Slope formula – m = (y2 – y1) / (x2 – x1)
- Line equation – y = mx + b
- Y-intercept – b = y1 – m×x1
- Midpoint – ((x1 + x2) / 2, (y1 + y2) / 2)
- Distance – √((x2 – x1)² + (y2 – y1)²)
- Slope angle – θ = arctan(m)
Frequently asked questions
Why is the slope undefined when x1 and x2 are the same?
The slope formula divides the vertical change by the horizontal change. If x1 and x2 are equal, the horizontal change is 0, so you would be dividing by 0. In that case the line is vertical and should be read as x = constant instead of using a regular slope value.
Can I use negative coordinates or decimals?
Yes. The calculator accepts positive numbers, negative numbers, and decimals. As long as Point A and Point B are not identical, the slope, midpoint, distance, and line equation can all be computed normally.
What is the difference between slope and slope angle?
Slope is a ratio of change, while slope angle is the angle the line makes with the x-axis. A slope of 1 corresponds to 45°, a slope of 0 corresponds to 0°, and a vertical line corresponds to 90°.
Why does the tool show the midpoint and distance too?
In coordinate geometry, midpoint and distance are often solved together with slope. Slope tells you the direction of the line, but midpoint and distance help you understand the segment itself, so seeing them together makes review and homework checks faster.
How is a horizontal line shown?
A horizontal line appears when both points share the same y-value. The vertical change is 0, so the slope is 0, the equation is shown as y = constant, and the slope angle is 0°.
Are my coordinates stored or sent to a server?
No. The coordinates and results stay in your browser for this tool. Refreshing the page or pressing Reset clears the current input immediately.
No comments yet. Leave the first opinion.