The slope calculator on this page takes any two points, (xβ, yβ) and (xβ, yβ), and works out the slope of the line that connects them, along with the y-intercept, the distance between the points, the midpoint, and the line's equation written three different ways: slope-intercept form, point-slope form, and standard form.
This is one of the most fundamental calculations in algebra and coordinate geometry, and Arb Digital built this free tool so you can check your homework, verify a graph, or quickly get a usable equation for a line without doing the algebra by hand every time.
What This Slope Calculator Does
Enter the coordinates of two points and the calculator instantly returns:
- The slope (m) of the line through the two points, or a clear "undefined" result for a vertical line
- The y-intercept (b), the point where the line crosses the y-axis
- The equation in slope-intercept form (y = mx + b)
- The equation in point-slope form (y β yβ = m(x β xβ))
- The equation in standard form (Ax + By = C)
- The straight-line distance between the two points
- The midpoint of the segment connecting them
- The angle of incline the line makes with the horizontal
- A full step-by-step derivation so you can see exactly how each value was calculated
How to Use the Slope Calculator
- Identify your two points. Any two distinct points on the line work β label the first (xβ, yβ) and the second (xβ, yβ). It doesn't matter which point you call "first," the slope comes out the same either way.
- Enter both x and y coordinates for each point into the four fields. Negative numbers and decimals are both fine.
- Click "Calculate Slope." The tool computes the rise-over-run ratio and every related value in one pass.
- Read the slope first. This single number tells you the line's steepness and direction β positive slopes rise, negative slopes fall, and a slope of exactly zero is a flat horizontal line.
- Grab the equation form you need. Slope-intercept form is usually what's asked for in intro algebra; point-slope form is handy when you only know a slope and one point; standard form is common in later coursework and for finding intercepts quickly.
- Check the step-by-step working under the input fields to see the actual arithmetic behind every value, including the rise/run subtraction and the y-intercept substitution.
The Slope Formula β How It's Calculated
The slope between two points is defined as "rise over run" β how much the line goes up or down (rise) for every unit it goes across (run):
m = (yβ β yβ) / (xβ β xβ)
Once you know the slope, the y-intercept comes from rearranging the slope-intercept equation y = mx + b and solving for b using either point: b = yβ β mΒ·xβ. From there, the three standard forms of a linear equation all describe the exact same line, just written differently for different purposes, as explained in resources like Khan Academy's linear equations unit:
- Slope-intercept form (y = mx + b) is the most common for graphing, since m and b can be read straight off the equation.
- Point-slope form (y β yβ = m(x β xβ)) is the most direct to write down immediately after finding the slope, since it uses the point you already have.
- Standard form (Ax + By = C, with A, B, C typically integers and A non-negative) is preferred in many textbooks for finding x- and y-intercepts quickly and for working with systems of equations.
Vertical Lines and Undefined Slope
If your two points share the same x-coordinate (xβ = xβ), the line connecting them is perfectly vertical, and the slope formula's denominator, (xβ β xβ), becomes zero. Dividing by zero is undefined in ordinary arithmetic, so a vertical line's slope is correctly described as undefined, not zero and not infinite (although "infinite steepness" is a common informal way people describe it). A vertical line's equation can't be written in slope-intercept form at all, because it isn't a function of x β instead it's simply written as x = (the shared x-coordinate). This calculator detects that case automatically and reports it clearly instead of returning a broken or misleading number.
By contrast, if the two points share the same y-coordinate (yβ = yβ), the line is perfectly horizontal, the slope is exactly 0, and the equation is simply y = (the shared y-coordinate) β flat lines are the one case where the slope is a real, well-defined number of zero rather than undefined.
Distance and Midpoint Between Two Points
Beyond the slope, two points also define a straight-line segment with a measurable length and a center point. The distance formula comes directly from the Pythagorean theorem β the horizontal and vertical gaps between the points form the two legs of a right triangle, and the segment connecting the points is the hypotenuse: distance = β((xβ β xβ)Β² + (yβ β yβ)Β²). The midpoint formula is simpler β it's just the average of the two x-coordinates and the average of the two y-coordinates: midpoint = ((xβ + xβ)/2, (yβ + yβ)/2). Both values are useful well beyond algebra homework β they show up constantly in geometry, physics (displacement problems), computer graphics, and mapping applications.
Understanding the Angle of Incline
The slope of a line is also directly related to the angle it makes with the horizontal x-axis. That angle equals the arctangent of the slope: angle = arctan(m). A slope of 1 corresponds to a perfect 45Β° incline, a very steep line approaches 90Β°, and a nearly flat line approaches 0Β°. This is a handy cross-check: if you calculate a slope of 3 for a line and the angle of incline doesn't come out to roughly 71.6Β°, something in the earlier arithmetic went wrong.
Parallel and Perpendicular Lines
Once you have the slope of one line, you automatically know a great deal about any other line related to it. Two lines are parallel if and only if they share the exact same slope β they never meet, no matter how far you extend them, because they climb or fall at identical rates. Two lines are perpendicular if and only if their slopes are negative reciprocals of each other, meaning you flip the fraction and change its sign: a line with slope 3 (or 3/1) is perpendicular to any line with slope β1/3. This relationship is a common follow-up question after finding a slope from two points β once you know m, you already know the slope of every line parallel to it (same m) and every line perpendicular to it (β1/m), without needing any additional points.
One special case worth knowing: a horizontal line (slope 0) and a vertical line (undefined slope) are always perpendicular to each other, even though the negative-reciprocal rule technically breaks down (you can't take the reciprocal of zero). Geometrically it still makes sense β a perfectly flat line and a perfectly upright line always meet at a right angle.
Slope in Real-World Contexts
Outside of algebra class, slope shows up constantly under different names. In construction and roofing, it's called pitch or grade, describing how steeply a roof or road rises. In finance, the slope of a line fitted to a price chart describes a rate of change or trend β how fast a value is growing or shrinking per unit of time. In physics, the slope of a position-versus-time graph gives you velocity, and the slope of a velocity-versus-time graph gives you acceleration. In every one of these cases, the underlying calculation is identical to what this tool performs: pick two points on the line or curve, subtract their y-values, subtract their x-values, and divide.
Arb Digital builds fast, high-converting websites and content β plus free calculators like this one to go with them. Explore more below, or get in touch if your site needs the same attention to detail.
Try the Quadratic Solver All Free ToolsCommon Mistakes to Avoid
- Swapping the order of subtraction. The numerator and denominator must use the points in the same order β (yβ β yβ) over (xβ β xβ), not (yβ β yβ) over (xβ β xβ), or the sign of your slope will flip.
- Treating a vertical line's slope as zero. A vertical line has an undefined slope; a horizontal line has a slope of exactly zero β these are opposite cases, not the same thing.
- Forgetting standard form usually wants integer coefficients. If your slope is a fraction, you'll typically clear the denominator by multiplying through before writing standard form.
- Mixing up point-slope form's sign. The formula is y β yβ = m(x β xβ); a common error is writing y + yβ or forgetting which point's coordinates to substitute.
- Rounding the slope before finding the y-intercept. Small rounding errors early on can shift your final equation β use the exact slope value until the last step.
Related Free Tools From Arb Digital
Pair this calculator with our Quadratic Equation Solver for curved (non-linear) equations, the Pythagorean Theorem Calculator for right-triangle side lengths, and the Scientific Calculator for any extra arithmetic along the way. For everyday number problems, try our Fraction Calculator and Ratio Calculator, or browse everything in our free online tools hub.
Frequently Asked Questions
The line is vertical and the slope is undefined, since the slope formula's denominator would be zero; the calculator reports this clearly instead of a number.
They describe the same line differently: slope-intercept (y = mx + b) is best for graphing, point-slope (y β yβ = m(x β xβ)) is fastest right after finding the slope, and standard form (Ax + By = C) is common for finding intercepts and solving systems.
It uses the Pythagorean theorem: distance = the square root of (xβ β xβ)Β² plus (yβ β yβ)Β², treating the horizontal and vertical gaps as the two legs of a right triangle.
The midpoint is the average of the two x-coordinates and the average of the two y-coordinates, giving the exact center point of the segment connecting them.
No, the slope comes out identical either way as long as you keep the same order in the numerator and denominator; swapping both points at once doesn't change the result.
It's the angle the line makes with the horizontal x-axis, calculated as the arctangent of the slope; a slope of 1 corresponds to a 45Β° angle.
This tool runs entirely in your browser using built-in JavaScript. Nothing you enter is uploaded, stored, or sent to any server.