Slope Calculator
Calculate the slope of a line between two points. Free online slope calculator with graph visualization, intercept, and step-by-step solutions.
Recent Calculations
Slope Calculator
This free online slope calculator computes the slope, angle, distance, and equation of a line between any two points $(x_1, y_1)$ and $(x_2, y_2)$ instantly in your browser, with an interactive graph and no server uploads.
$$m = \frac{\text{rise}}{\text{run}} = \frac{\Delta y}{\Delta x} = \frac{y_2 - y_1}{x_2 - x_1}$$
A line with positive slope rises as it moves from left to right. A line with negative slope falls as it moves from left to right. A horizontal line has slope $0$, and a vertical line has an undefined slope.
$$y = mx + b$$
where $m$ is the slope and $b$ is the $y$-intercept (where the line crosses the $y$-axis). Given two points, the slope is calculated first, then the $y$-intercept is found by substituting one point into the equation: $b = y - mx$.
$$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$$
This is derived from the Pythagorean theorem and represents the length of the straight line segment connecting the two points.
$$\theta = \arctan(|m|)$$
This can also be expressed as a percentage grade: $\text{grade} = m \times 100\%$.
Frequently Asked Questions
Got questions about slope, linear equations, or how to use this tool? We've got answers.
What is the slope of a line?
The slope of a line measures its steepness and direction. It is defined as the ratio of the vertical change (rise) to the horizontal change (run) between any two points on the line: $m = \frac{\text{rise}}{\text{run}} = \frac{\Delta y}{\Delta x} = \frac{y_2 - y_1}{x_2 - x_1}$. A positive slope means the line rises from left to right, while a negative slope means it falls.
What does the slope-intercept form tell us?
The slope-intercept form $y = mx + b$ gives two key properties of a line at a glance: $m$ is the slope (steepness and direction), and $b$ is the y-intercept (where the line crosses the y-axis). For example, $y = 2x + 3$ has a slope of 2 and crosses the y-axis at $(0, 3)$.
What happens when a line is vertical or horizontal?
A horizontal line has an equation of the form $y = b$ (slope $m = 0$), since there is no vertical change. A vertical line has an equation of the form $x = a$ (slope is undefined), since division by zero occurs when calculating its slope. The angle of a horizontal line is $0°$, while a vertical line has an angle of $90°$.
How do I calculate the angle of a line?
The angle of a line relative to the horizontal (x-axis) is given by $\theta = \arctan(|m|)$ in radians, or $\theta = \arctan(|m|) \cdot \frac{180}{\pi}$ in degrees. For a slope of $m = 1$, the angle is $45°$. The angle can also be expressed as a percentage grade — a $100\%$ grade corresponds to a $45°$ angle.
How are parallel and perpendicular lines related by slope?
Two lines are parallel if they have the same slope ($m_1 = m_2$) but different y-intercepts. Two lines are perpendicular if the product of their slopes equals $-1$ ($m_1 \cdot m_2 = -1$), meaning one slope is the negative reciprocal of the other. For example, slopes of $2$ and $-\frac{1}{2}$ produce perpendicular lines.
What is the difference between slope and grade?
Slope is typically expressed as a decimal or fraction ($m = \Delta y / \Delta x$). Grade (or slope percentage) multiplies this by 100: $\text{grade} = m \times 100\%$. A slope of 0.05 corresponds to a 5% grade, meaning the elevation changes 5 units vertically for every 100 units horizontally.
Is this calculator private?
Yes. All calculations run locally in your browser. No data is transmitted, logged, or stored on any server. The graph is rendered entirely on your device using the HTML5 Canvas API.