Calculator Tools
Slope Calculator
Find the slope, equation, midpoint, distance, intercepts, and angle of the line through two points. Step-by-step with parallel and perpendicular slopes.
Slope calculator
Enter two points P1 = (x1, y1) and P2 = (x2, y2)
Each field accepts integers, decimals, or simple fractions like 3/4. Use a leading minus for negative values.
Point P1
Point P2
Slope (m)
2
Rising line. As x increases, y increases.
Rise (dy)
4
y2 minus y1
Run (dx)
2
x2 minus x1
Slope formula
4 / 2
m = rise / run
Equation of the line
Three standard ways to write the same line.
Slope-intercept (y = mx + b)
y = 2x
Point-slope
y - 2 = 2 * (x - 1)
Standard form
2x - y = 0
Intercepts and key points
Where the line crosses each axis, plus the midpoint of P1 and P2.
y-intercept
(0, 0)
b in y = m x + b
x-intercept
(0, 0)
where the line crosses the x-axis
Midpoint
(2, 4)
((x1 + x2) / 2, (y1 + y2) / 2)
Distance P1 to P2
4.472136
sqrt(dx^2 + dy^2)
Angle of inclination
The angle the line makes with the positive x-axis, measured from the x-axis going counter-clockwise.
Degrees
63.434949 deg
Radians
1.107149 rad
Parallel and perpendicular slopes
Lines parallel to this line share its slope. Lines perpendicular to it have a slope that multiplies with m to give -1.
Parallel slope
2
Perpendicular slope
-0.5 (-1/2)
Perpendicular slopes multiply to -1: m * m_perp = -1, so m_perp = -1 / (2) = -0.5.
Step-by-step
Each line shows the substitution used to reach the next result.
- Label the points P1 = (1, 2) and P2 = (3, 6).
- Compute the differences: dx = x2 - x1 = 2, dy = y2 - y1 = 4.
- Compute the slope: m = dy / dx = 4 / 2 = 2.
- Compute the y-intercept: b = y1 - m * x1 = 2 - (2)(1) = 0.
- Slope-intercept form: y = 2x.
- Point-slope form (using P1): y - 2 = 2(x - 1).
- Standard form (cleared of fractions where possible): 2x - y = 0.
- Midpoint: M = ((x1 + x2) / 2, (y1 + y2) / 2) = (2, 4).
- Distance: d = sqrt(dx^2 + dy^2) = sqrt(4 + 16) = 4.472136.
- Angle of inclination: theta = atan(m) = 1.107149 rad = 63.434949 degrees.
The slope formula
m = (y2 - y1) / (x2 - x1)
- Slope describes how steep a line is and which direction it goes. Bigger absolute slope means a steeper line.
- A positive slope rises from left to right. A negative slope falls from left to right.
- A slope of 0 means the line is horizontal. An undefined slope means the line is vertical and the run (dx) is zero.
Three equation forms
- y = m x + b is the slope-intercept form. b is where the line crosses the y-axis.
- y - y1 = m (x - x1) is the point-slope form, built directly from any single point on the line and the slope.
- A x + B y = C is the standard form. This tool clears fractions and divides by gcd(A, B, C) when the inputs are rational so the coefficients are clean integers.
How to use
- Type the x1 and y1 coordinates of the first point P1.
- Type the x2 and y2 coordinates of the second point P2. Each field accepts integers, decimals, or simple fractions like 3/4.
- Read the headline slope card for the value of m, with a fraction shown when the inputs are rational.
- Check the Equation of the line panel for slope-intercept, point-slope, and standard form versions of the same line.
- Use the Intercepts and key points panel for the x-intercept, y-intercept, midpoint, and distance from P1 to P2.
- Use the Angle of inclination and Parallel and perpendicular slopes panels for trig and geometry follow-up questions.
- Read the Step-by-step block to see how each value was derived, then click Copy full report to paste the breakdown into a homework write-up or a notes app.
- Try a preset, click Swap P1 and P2 to confirm slope is symmetric, or click Clear to start over.
About this tool
Slope Calculator takes two points P1 = (x1, y1) and P2 = (x2, y2) and returns every analytic-geometry property of the line that passes through them. The slope m = (y2 - y1) / (x2 - x1) is shown as a decimal and, when the inputs are rational, as a simplified fraction so it matches the answer expected on a homework key. The equation of the line is shown in three standard forms at once: slope-intercept (y = m x + b), point-slope (y - y1 = m (x - x1)), and standard form (A x + B y = C). When the inputs are rational, the standard form is cleared of fractions and reduced by gcd(A, B, C) so A, B, and C are clean integers and A is non-negative. The y-intercept, x-intercept (when one exists), the midpoint ((x1 + x2)/2, (y1 + y2)/2), and the distance sqrt(dx^2 + dy^2) are all derived from the same two points. The angle of inclination is reported in degrees and radians, and the slopes of any line parallel or perpendicular to this line are also given, with the vertical and horizontal edge cases called out clearly. Inputs accept integers, decimals, comma-decimals, and simple fractions like 3/4 or -7/8, so you can plug in textbook problems directly. A step-by-step derivation mirrors how the work would be shown in class. Everything runs in your browser; the points you type here never leave your device.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Quadratic Equation Solver
Roots, discriminant, vertex, factored form, and step-by-step working for any quadratic.
Open tool
CalculatorRight Triangle Calculator
Solve any right triangle and see sides, angles, area, perimeter, and trig values with shown steps.
Open tool
CalculatorLat Long Distance Calculator
Distance, initial bearing, and midpoint between two lat/long pairs.
Open tool
CalculatorFraction Calculator
Add, subtract, multiply, and divide fractions with simplified results and step-by-step working.
Open tool
CalculatorGCD and LCM Calculator
GCD and LCM for any set of integers, with Euclidean steps and prime factorization.
Open tool