Slope CalculatorFree online math calculator — instant results, no sign-up
Slope, angle and line equation through two points.
About the Slope Calculator
This calculator determines the geometric properties of a line passing through two distinct coordinate points, (x₁, y₁) and (x₂, y₂). It computes the slope, slope-intercept line equation, angle of inclination, and Euclidean distance between the points. Students, engineers, and designers use this tool to quickly analyze linear relationships in Cartesian coordinates.
- x₁
- Horizontal coordinate of the first point, any real number.
- y₁
- Vertical coordinate of the first point, any real number.
- x₂
- Horizontal coordinate of the second point, any real number.
- y₂
- Vertical coordinate of the second point, any real number.
Formula and method
m = (y₂ - y₁) / (x₂ - x₁) b = y₁ - m × x₁ Equation: y = m × x + b Angle = arctan(m) × (180 / π) Distance = √((x₂ - x₁)² + (y₂ - y₁)²)
- mSlope (steepness or rate of change) of the line
- by-intercept where the line crosses the y-axis (x = 0)
- AngleAngle of inclination in degrees relative to the positive x-axis
- DistanceStraight-line Euclidean distance between the two points
The tool calculates the slope by dividing the change in y by the change in x, then derives the y-intercept using the point-slope form. The inclination angle is derived using the arctangent of the slope converted to degrees, and the distance is calculated via the Pythagorean theorem. Results for slope and distance are rounded to 6 decimal places, while the equation coefficients and angle are rounded to 4 decimal places.
Worked example
These are the calculator's starting values and the results it actually produces for them.
Inputs
- x₁1
- y₁2
- x₂4
- y₂8
Results
- Slope2
- Equationy = 2x + 0
- Angle63.4349°
- Distance6.708204
How to use the Slope Calculator
- 1Subtract x₁ from x₂ to find horizontal change (Δx), and y₁ from y₂ to find vertical change (Δy).
- 2Divide Δy by Δx to compute the slope m.
- 3Solve for the y-intercept b using b = y₁ - m × x₁ to form the line equation y = mx + b.
- 4Calculate the angle using arctan(m) in degrees and the Euclidean distance using the square root of (Δx² + Δy²).
Reading your result
A positive slope indicates the line rises from left to right, while a negative slope indicates it falls. The inclination angle falls between -90° and 90°, representing the tilt relative to the horizontal axis. The distance gives the total straight-line segment length connecting the two input coordinates.
Limitations
The calculation divides by (x₂ - x₁), meaning it cannot handle vertical lines where x₁ equals x₂ (division by zero yielding an undefined slope). It also assumes standard flat Euclidean 2D space and does not support curved or spherical geometry.
Common questions
What happens if x₁ equals x₂?+
When x₁ equals x₂, the line is completely vertical. The denominator (x₂ - x₁) becomes zero, which results in an undefined slope and an angle that cannot be evaluated normally.
Can the angle of inclination be negative?+
Yes. If the slope is negative, the arctangent function yields a negative angle between 0° and -90°, showing that the line slopes downward relative to the horizontal axis.
Does the order of the points matter?+
No. Swapping (x₁, y₁) and (x₂, y₂) yields the exact same slope, line equation, and distance because both (y₂ - y₁) and (x₂ - x₁) reverse sign simultaneously, preserving the ratio.
Does the calculator save my information?+
Calculations run in your browser. While signed in, inputs and results are automatically recorded in account history; saving a result creates a separate saved record.
Further reading
You might also like
Area Calculator
Area of common 2D shapes.
Volume Calculator
Volume of common 3D shapes.
Surface Area Calculator
Surface area of 3D shapes.
Circle Calculator
Radius, diameter, circumference and area.
Triangle Calculator
Solve a triangle from three sides.
Right Triangle Calculator
Solve a right triangle from its two legs.
Results are estimates for informational purposes and are not financial, medical or legal advice.