Slope Calculator
Calculate slope, y-intercept, line equation, angle of inclination, and distance between two points on a coordinate plane.
Did this tool work for you?
How to use this calculator
Slope m is the rise over run between two points. The y-intercept b satisfies y = mx + b at any point on the line.
- 1
Enter the coordinates of two points: (x₁, y₁) and (x₂, y₂).
- 2
The slope m = (y₂−y₁)/(x₂−x₁) is calculated along with the y-intercept.
- 3
The full line equation y = mx + b is displayed, ready to use in further calculations.
- 4
Distance, angle of inclination, and midpoint are also provided automatically.
Frequently asked questions
What does a negative slope mean?
A negative slope means the line falls from left to right. For every unit you move right along the x-axis, the y value decreases by |m| units. A slope of −2 means a rise of −2 for each run of 1.
What is the difference between slope and gradient?
In mathematics, slope and gradient are the same thing for a straight line. In physics and engineering, gradient often refers to a vector quantity pointing in the direction of steepest ascent. For a 2D line, they are interchangeable.
How do I find the equation of a line parallel or perpendicular to this one?
Parallel lines share the same slope m. A perpendicular line has slope −1/m (the negative reciprocal). Use y − y₀ = m·(x − x₀) with your new slope and any point on the new line to find its equation.
What does it mean when the slope is zero?
A slope of zero means the line is perfectly horizontal — y does not change as x increases. The equation simplifies to y = b (a constant). This represents no rate of change, e.g., a horizontal road section or a flat price level.
Slope calculator — line equations, angles, and distance
Rise over run: interpreting slope
Slope is the ratio of vertical change (rise) to horizontal change (run) between any two points on a straight line. A slope of 3 means for every 1 unit moved right, y increases by 3 — a steep upward line. Slope = 0 is horizontal; undefined slope is vertical. In real life, road grades are expressed as percentages (slope × 100): a 5% grade rises 5 meters for every 100 meters of horizontal distance.
Slope-intercept and point-slope forms
The slope-intercept form y = mx + b is the most common line representation. The point-slope form y − y₁ = m(x − x₁) is useful when you know a point on the line and its slope but not the y-intercept. Both forms are equivalent; the calculator outputs slope-intercept form because it directly reveals where the line crosses the y-axis, which is useful for graphing and systems of equations.
Applications in data analysis and machine learning
Linear regression finds the line of best fit through a scatter plot; its slope quantifies how much the dependent variable changes per unit of the independent variable. In machine learning, gradient descent moves model parameters in the direction of steepest negative slope to minimize a loss function — making slope calculation foundational to all of modern AI training.
Learn more from an authoritative source:
WikipediaScientific Calculator
Evaluate mathematical expressions including trigonometry, logarithms, exponents, and more.
Percentage Calculator
Quickly calculate percentages, percentage change, and percentage of a total.
Fraction Calculator
Add, subtract, multiply, or divide two fractions and get the simplified result instantly.
Ratio Calculator
Simplify ratios, find missing values, and scale ratios up or down.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →