Slope Calculator
Enter two coordinate points to instantly calculate slope (rise over run), y-intercept, the line equation y=mx+b, angle in degrees, distance between points, and parallel and perpendicular slopes.
Last updated: March 2026
Point 1 (x₁, y₁)
Point 2 (x₂, y₂)
How to Use the Slope Calculator
- Enter Point 1 — type the x₁ and y₁ coordinates of your first point. Use negative numbers where needed.
- Enter Point 2 — type the x₂ and y₂ coordinates of your second point. The two points must be distinct.
- Read results instantly — slope appears as the primary result. The secondary panel shows the y-intercept, full line equation, point-slope form, angle, distance, rise/run, and parallel/perpendicular slopes.
- Use the equations — copy the slope-intercept form y=mx+b or point-slope form for use in further calculations or graphing.
Slope: Rise Over Run Explained
The slope of a line is the ratio of the vertical change (rise) to the horizontal change (run) between any two points on the line. The formula is: m = (y₂ − y₁) / (x₂ − x₁). The letter m is used universally for slope, a convention dating back to 19th-century French mathematics.
Types of Slope
Positive slope (m > 0): The line rises from left to right. The larger the value, the steeper the ascent. A slope of 4 is steeper than a slope of 1.
Negative slope (m < 0): The line falls from left to right. As x increases, y decreases. A slope of −3 falls steeply; −0.5 falls gently.
Zero slope (m = 0): A horizontal line. Y is constant — there is no rise regardless of how far you move left or right.
Undefined slope: A vertical line. X is constant, so the run is zero and division by zero is undefined. Vertical lines cannot be represented in y=mx+b form.
Slope as a Percentage Grade
In civil engineering and road design, slope is expressed as a percentage grade: Grade % = (rise/run) × 100. A 5% grade means for every 100 horizontal metres, the road rises or falls 5 metres. The slope calculator's rise/run output gives you this directly — multiply by 100 for the percentage grade.
Real-World Applications
Slope is fundamental in physics (velocity on position-time graphs), economics (marginal cost curves), architecture (roof pitch), civil engineering (road grades), and data science (linear regression). The slope of a tangent line to a curve at a given point is the derivative in calculus — the foundation of differential calculus.
Line Equations: Slope-Intercept, Point-Slope, and Standard Form
A straight line can be expressed in several equivalent forms, each useful in different contexts. Understanding all three forms and how to convert between them is a core algebra skill.
Slope-Intercept Form: y = mx + b
This is the most commonly used form. m is the slope and b is the y-intercept (the y-coordinate where the line crosses the y-axis, i.e., where x=0). This form is ideal for graphing: plot the y-intercept first, then use the slope to find more points. The y-intercept is calculated as b = y₁ − m × x₁ using any known point on the line.
Point-Slope Form: y − y₁ = m(x − x₁)
Point-slope form uses a known point (x₁, y₁) and the slope m. It is especially useful when you are given one point and the slope (rather than two points) and need to write the equation quickly. Rearranging gives: y = m(x − x₁) + y₁, which can be further simplified to slope-intercept form.
Standard Form: Ax + By = C
Standard form uses integer coefficients with A ≥ 0 and no common factors. It is useful for systems of linear equations and for lines where slope-intercept form is awkward (like vertical lines: x = k can be written as 1x + 0y = k). To convert from y=mx+b: multiply through and rearrange to get mx − y = −b, then multiply by −1 if needed.
Parallel and Perpendicular Lines
Parallel lines have the same slope (m₁ = m₂) but different y-intercepts. They never intersect. Perpendicular lines meet at a right angle (90°). Their slopes satisfy m₁ × m₂ = −1, so m₂ = −1/m₁ (the negative reciprocal). For a line with slope 2/3, the perpendicular slope is −3/2. A horizontal line (m=0) is perpendicular to a vertical line (undefined slope) — the negative reciprocal rule does not apply symbolically but the geometric relationship holds.
Worked Examples: Finding Slope and Line Equations
What is the slope of the line through (1, 2) and (4, 8)?
Slope = 2. m = (8 − 2) / (4 − 1) = 6 / 3 = 2. Rise = 6, run = 3. Line equation: y = 2x + b → b = 2 − 2×1 = 0 → y = 2x.
What is the slope of the line through (−3, 5) and (2, −5)?
Slope = −2. m = (−5 − 5) / (2 − (−3)) = −10 / 5 = −2. A falling line from left to right.
What is the y-intercept of the line through (3, 7) with slope 4?
b = −5. y = mx + b → 7 = 4(3) + b → 7 = 12 + b → b = −5. Line: y = 4x − 5.
What is the distance between (0, 0) and (3, 4)?
Distance = 5. √((3−0)² + (4−0)²) = √(9+16) = √25 = 5. This is the classic 3-4-5 right triangle.
What is the perpendicular slope to a line with slope 3/4?
Perpendicular slope = −4/3. The negative reciprocal of 3/4 is −4/3.
What is the angle of a line with slope 1?
45 degrees. θ = arctan(1) = 45°. A slope of 1 means rise equals run, which is a 45° angle from the x-axis.
What is the slope of the line y = 7 (horizontal)?
Slope = 0. Y is constant at 7, so there is no rise. m = 0/run = 0.
What is the equation of a line parallel to y = 3x + 2 passing through (1, 5)?
y = 3x + 2 is already the answer — or y = 3x + 2. A parallel line has the same slope (m=3). Using point (1,5): b = 5 − 3×1 = 2. Equation: y = 3x + 2. In this case the line happens to be identical. If the point were (2, 7): b = 7 − 6 = 1 → y = 3x + 1.
People Also Search For
How to find slope from an equation (not two points)
In y = mx + b form, the slope is the coefficient m. For y = −4x + 7, slope = −4. For standard form Ax + By = C, rearrange: y = (−A/B)x + (C/B), so slope = −A/B. For 3x + 2y = 6: slope = −3/2.
How to find slope as a fraction
Leave the rise/run ratio unsimplified, then reduce by the GCF. For points (2, 3) and (8, 7): rise = 4, run = 6. Slope = 4/6 = 2/3. Express as a fraction when exact representation is needed rather than a decimal.
What does a slope of 0.5 mean?
For every 2 units moved horizontally, the line rises 1 unit. A slope of 0.5 (or 1/2) is a gentle positive incline. It makes a 26.6° angle with the x-axis (arctan(0.5) ≈ 26.57°).
How is slope used in linear regression?
In linear regression, the slope of the best-fit line represents the rate of change of the dependent variable per unit increase in the independent variable. If the regression line is y = 2.3x + 10, the slope 2.3 means y increases by 2.3 units for each 1-unit increase in x.
How do you find the x-intercept from slope and y-intercept?
Set y = 0 and solve: x = −b/m. For y = 3x − 9: 0 = 3x − 9 → x = 3. The line crosses the x-axis at (3, 0).
Frequently Asked Questions
What is the slope formula?
The slope formula is m = (y₂ − y₁) / (x₂ − x₁), often described as "rise over run." It measures the steepness and direction of a straight line through two points.
What is the slope of a horizontal line?
The slope of a horizontal line is 0. Y does not change as x changes, so rise = 0 and m = 0/run = 0. Examples: y = 5, y = −3.
What is undefined slope?
Undefined slope belongs to vertical lines. X does not change, so run = 0, and division by zero is undefined. Vertical lines are written as x = k (e.g., x = 4) and cannot be expressed in y=mx+b form.
How do parallel lines relate to slope?
Parallel lines have equal slopes (m₁ = m₂) but different y-intercepts. They never intersect. For example, y = 2x + 3 and y = 2x − 7 are parallel because both have slope 2.
How do perpendicular lines relate to slope?
The slopes of perpendicular lines are negative reciprocals: m₂ = −1/m₁, or equivalently m₁ × m₂ = −1. A line with slope 3 is perpendicular to a line with slope −1/3.
What is slope-intercept form?
Slope-intercept form is y = mx + b, where m is the slope and b is the y-intercept. It is the most common way to write a line equation because both key parameters are immediately visible.
Can two different pairs of points on the same line give different slopes?
No. Any two distinct points on a straight line produce the same slope. Slope is a property of the entire line, not of specific points. If you get different slopes from different point pairs, the points do not all lie on the same straight line.
How does slope relate to the angle of the line?
The angle θ a line makes with the positive x-axis is θ = arctan(m). A slope of 1 gives 45°, a slope of √3 gives 60°, and a slope approaching infinity approaches 90° (vertical). The angle is always measured counterclockwise from the positive x-axis.
What is the midpoint between two points?
The midpoint formula is ((x₁+x₂)/2, (y₁+y₂)/2). It finds the exact centre point of the segment between two coordinates. Use our Midpoint Calculator for a dedicated tool.
Does this calculator store my data?
No. All calculations run entirely in your browser. No coordinates are sent to any server and nothing is stored after you close the page.