Slope Calculator
Result
Slope
- y-intercept
- 0.000000
- Slope angle
- 63.4349
A slope calculator finds the slope of a straight line from either of the two ways a line is usually given: two points on it, or its line equation in the form ax + by = c. Along with the slope it reports the y-intercept and the angle the line makes with the horizontal. The mode selector at the top decides which group of boxes is read — with two points, the slope is the change in y divided by the change in x; with an equation, it is minus a over b, and the intercept is c over b. Both groups of boxes stay on the screen at once and the unused one is not greyed out, so a number typed into the wrong group has no effect and produces no warning; switching the selector is what makes those boxes count. A vertical line is refused rather than reported as an infinite slope, because an infinity is not a number you can take to the next step, and a vertical line genuinely has no slope. The angle reported is the arctangent of the slope, which runs from −90 to 90 degrees: a line falling to the right comes back as a negative angle, where the inclination angle taught in geometry books would call the same line 135 degrees. Neither output carries a unit, because a slope is a pure number — it only means 'so much per unit' when both axes are measured in the same thing.
Common slopes and the angles they make
| Slope | Angle (degrees) |
|---|---|
| 0 | 0 |
| 1 | 45 |
| -1 | -45 |
| 0.5 | 26.5651 |
| 2 | 63.4349 |
| 3 | 71.5651 |
| -3 | -71.5651 |
| 0.25 | 14.0362 |
Eight rows of slopes that turn up constantly, with the angle each one makes with the horizontal. The first column is the answer this page produces and the second is that answer put through the arctangent, so the table is a set of worked results rather than a set of inputs — nothing here is a coordinate. Two rows are worth knowing by heart because their angles are exact: a slope of 1 is 45 degrees and a slope of −1 is −45. The values are limited to four decimals and to numbers with a single decimal point, deliberately: table cells are not localized, so a reader in a language that writes 1,414214 would have to read a two-separator number out of context. Every cell is recomputed from its row when the page is built.
Formula
m = (y₂ − y₁) ÷ (x₂ − x₁) b = y₁ − m·x₁ ax + by = c ⇒ m = −a ÷ b, b = c ÷ b
- x₁, y₁, x₂, y₂
- The two points, used when the selector is set to two points. The first point and the second point are interchangeable — swapping them flips the sign of both the numerator and the denominator, so the slope comes out the same. What is not interchangeable is putting an x into a y box: nothing checks that, and the result will be a number that looks entirely ordinary
- a, b, c
- The three coefficients of the line equation ax + by = c, used when the selector is set to the equation. They are read only in that mode, and in the other mode they are ignored without any indication on screen. Note that b here is the coefficient of y, not the y-intercept — the intercept is a separate output, and confusing the two is the most common mistake with this form
- m = (y₂ − y₁) ÷ (x₂ − x₁)
- The slope from two points: rise over run. It is the same number however far apart the points are, which is what makes a line straight — take two points a mile apart or two points a millimetre apart and the ratio is unchanged. The one case that breaks it is x₁ equal to x₂, where the denominator is zero and the line is vertical
- m = −a ÷ b
- The slope from the line equation, obtained by rearranging ax + by = c into y = (−a ÷ b)x + (c ÷ b). The minus sign is easy to drop, and dropping it gives a slope of the right magnitude with the wrong sign — which is exactly the error that makes a line appear to rise when it falls. When b is zero the rearrangement divides by zero and the line is vertical, so that case is refused rather than approximated
- b = y₁ − m·x₁
- The y-intercept, where the line crosses the vertical axis. It is computed from the slope and one of the points rather than read off a graph, and it is printed for every input including the ones where it is zero. A line through the origin has an intercept of exactly 0, which is worth seeing explicitly: it is the case where the equation has no constant term at all
- angle = arctan(m)
- The slope angle, the arctangent of the slope in degrees, which lies between −90 and 90. A slope of 1 gives 45 degrees, a slope of −1 gives −45, and a horizontal line gives 0. It is not the inclination angle used in coordinate geometry, which runs from 0 to 180 and would report 135 for the same −45 line; the arctangent is used here because it is the angle that follows directly from the slope, one to one and invertible
Use it when a slope has to come out of a line you have been given in either standard form, and also when the equation of a line needs to be read for its slope and intercept without being rearranged by hand — 2x + 3y = 6 is a slope of −2/3 and an intercept of 2 in one step. It is the page for checking a line you have already drawn: a slope that comes back with the wrong sign, or an intercept that does not match where the line crosses the axis, means the equation was misread somewhere. The angle is useful when the slope has to be compared against a physical incline, though it is the arctangent and not the inclination, so read that column with the difference in mind. Reach for the rise over run calculator when the question is about a grade rather than a line — same arithmetic, different vocabulary, and that page speaks in percent grades and ramps. Reach for the quadratic formula calculator when the equation has an x² term, since a curve has no single slope and that page finds where it crosses zero instead. Reach for the point slope form calculator when the slope is known and the equation is what you want, which is this page's question read backwards.
Worked examples
The line through (1, 2) and (4, 8)
- The change in y: 8 − 2 = 6
- The change in x: 4 − 1 = 3
- The slope: 6 ÷ 3 = 2
- The intercept: 2 − 2 × 1 = 0, so the line passes through the origin
- The angle: arctan(2) = 63.4349 degrees
The two-point case with every answer a round number except the angle — which is the ordinary situation, since the arctangent of a rational slope is almost never a whole number of degrees. The intercept of exactly 0 is worth pausing on: it says the equation of this line is y = 2x with nothing added, and a reader who expected an intercept to be some visible distance up the axis is looking at a line that crosses right at the origin.
The line through (0, 3) and (4, 0)
- The change in y: 0 − 3 = −3
- The change in x: 4 − 0 = 4
- The slope: −3 ÷ 4 = −0.75, negative because the line falls to the right
- The intercept: 3 − (−0.75 × 0) = 3, which is visible on the graph as the point (0, 3)
- The angle: arctan(−0.75) = −36.8699 degrees
The negative slope, and the case where the angle convention matters. This line falls to the right, so the angle is negative — a geometry textbook would call the same line's inclination 143.13 degrees, and the two numbers describe one line. The intercept here is the easiest possible to verify, since the first point has an x of 0 and sits exactly on the vertical axis.
The line 2x + 3y = 6
- Rearrange into y = mx + b: 3y = 6 − 2x, so y = 2 − (2 ÷ 3)x
- The slope is −a ÷ b = −2 ÷ 3 = −0.666667
- The intercept is c ÷ b = 6 ÷ 3 = 2
- The angle: arctan(−0.666667) = −33.6901 degrees
- The check: at x = 0 the equation reads 3y = 6, so y = 2, which is the intercept
The equation mode, and the case that shows why the formula has a minus sign in it. Dropping that sign gives 0.666667 instead of −0.666667 — the same steepness, rising instead of falling, which is the kind of error a check against the original equation catches and a glance at the number does not. The intercept can be confirmed by setting x to zero in the equation rather than by trusting the formula.
The line x − y = 4
- Rearrange: −y = 4 − x, so y = x − 4
- The slope is −a ÷ b = −1 ÷ (−1) = 1
- The intercept is c ÷ b = 4 ÷ (−1) = −4
- The angle: arctan(1) = 45 degrees exactly
A negative b, which is where the two minus signs in the formulas cancel and the answers come out positive. It is also one of the few lines whose angle is a whole number of degrees: a slope of 1 is 45 degrees and a slope of −1 is −45, which is why those two rows sit in the reference table. The intercept of −4 says the line crosses below the origin, which a reader who assumed a negative coefficient meant a negative slope would get exactly backwards.
The horizontal line through (2, 5) and (6, 5)
- The change in y: 5 − 5 = 0
- The change in x: 6 − 2 = 4
- The slope: 0 ÷ 4 = 0 — a horizontal line, and its slope is zero rather than undefined
- The intercept: 5 − 0 × 2 = 5, the height the line sits at
- The angle: arctan(0) = 0 degrees
The zero slope, which is the case most often confused with the vertical line this page refuses. A horizontal line has a slope of exactly zero — it neither rises nor falls — while a vertical line has no slope at all, and the difference is whether the zero lands in the numerator or the denominator. Every output here is a clean number, which makes it the easiest row on the page to check against a sketch.
Limitations
The two groups of input boxes are both on screen and the mode selector decides which one is read. The group that is not being read is not greyed out — the page cannot do that — so numbers typed into the wrong group are ignored silently, and the result will not move when they are changed. That is the one behaviour on this page that cannot be discovered from the screen, and the only fix is to check the selector: the two-point boxes are read when it says two points, and the a, b and c boxes are read when it says line equation. Vertical lines are refused in both modes rather than reported as an infinite slope, because infinity is not a usable number and a vertical line genuinely has no slope; a horizontal line is a different case entirely and comes back as a slope of exactly zero. The angle is the arctangent of the slope and runs from −90 to 90 degrees, not the 0-to-180 inclination used in coordinate geometry — the same falling line is −45 here and 135 there, and confusing the two puts a sign error into anything computed from the angle. The slope is a pure number with no unit, which is only meaningful when both axes are measured in the same thing: a slope of 5 between a distance in metres and a time in seconds is 5 metres per second, and the page will not say so. The coordinates are bounded at a million in absolute value, which is a display range. There are no grades: how steep a line is has no authoritative threshold, and the sign of the slope already tells you whether it rises or falls. Finally, the page handles straight lines only — a curve has a different slope at every point, and nothing here computes a derivative.
Frequently asked questions
- Why does changing a box sometimes not change the answer?
- Because the mode selector is set to the other group. Both groups of boxes are always on screen, and only one of them is read at a time: with the selector on two points, the a, b and c boxes are ignored entirely, and with it on the equation, the four coordinate boxes are. The unused group is not greyed out, so the selector is the only indication of which numbers count — check it first whenever a result looks stuck.
- What is the slope of a vertical line?
- It has none, and this page refuses that input rather than printing infinity. The slope is the change in y divided by the change in x, and on a vertical line the change in x is zero, so the arithmetic asks you to divide by zero. Infinity is not a number you can carry into the next step, and saying the slope is infinite would suggest a very large number rather than no number at all. A horizontal line is the opposite case: its slope is exactly zero.
- How do I find the slope from an equation?
- Rearrange ax + by = c into y = mx + b. Doing that gives a slope of −a ÷ b and an intercept of c ÷ b, which is what the page computes when the selector is set to the equation. The sign matters more than it looks: for 2x + 3y = 6 the slope is −2/3, and dropping the minus gives a line of the same steepness going the other way.
- What is the difference between the slope angle and the inclination angle?
- The slope angle is the arctangent of the slope and lies between −90 and 90 degrees; the inclination angle used in coordinate geometry lies between 0 and 180. For a line that falls to the right they disagree by 180 degrees: this page reports −45 for a slope of −1, while the inclination of the same line is 135. This page uses the arctangent because it follows from the slope directly and one to one, with no extra rule about adding 180 for negative slopes.
- Does the slope have a unit?
- Not on its own. A slope is a ratio of two changes, so it is a pure number, and it only becomes 'so much per unit' when both axes are measured in the same thing — metres along each axis give a dimensionless number, while metres against seconds give metres per second. The page does not ask, so it cannot convert or label; if the axes are in different units, the slope is a rate and the unit is the one thing the page cannot supply.
- Can I use this to find the equation of a line?
- No — this page goes the other way. It takes a line that is already described, either by two points or by an equation, and reports its slope and intercept. Going from a slope and a point to the equation is a different task, and the point slope form calculator is the page for it. What this page does give you along the way is the intercept, and slope plus intercept is already the slope-intercept form of the equation if you want to write it down yourself.
References
- Slope — the definition of the slope of a line as rise over run, with the two-point and equation forms this page evaluates — Wolfram MathWorld (United States)
- Line — the general equation ax + by = c and its rearrangement into slope-intercept form, including the vertical case where b is zero — Wolfram MathWorld (United States)
- Inverse Tangent — the arctangent used for the angle column, and the range from −90 to 90 degrees that distinguishes it from the inclination angle — Wolfram MathWorld (United States)