Find the slope between two points, along with the line equation and distance between them.
Slope measures how steep a line is — it's the ratio of vertical change to horizontal change between two points, calculated as m = (y2 − y1) ÷ (x2 − x1). A slope of 2 means the line rises 2 units for every 1 unit it moves right; a negative slope means the line falls as it moves right.
Once you know the slope and one point on the line, you can find the y-intercept using b = y1 − m × x1, which gives you the complete equation in slope-intercept form: y = mx + b. This calculator also reports the straight-line distance between your two points using the distance formula, and the angle the line makes with the horizontal axis.
This tool works for any two points on a standard Cartesian (x, y) plane.
Enter the x and y coordinates of two points on a line. Click Calculate, and the tool returns the slope, the full line equation in slope-intercept form, the distance between the two points, and the angle the line makes with the horizontal. This is useful for geometry homework, graphing lines, or any situation where you need to describe a line's steepness and direction from just two known points on it.
Slope describes both the steepness and direction of a line in a single number. A larger absolute value means a steeper line — a slope of 5 rises much more sharply than a slope of 0.5 for the same horizontal distance. The sign tells you direction: positive slope means the line rises as it moves left to right, negative slope means it falls. A slope of exactly 0 means a perfectly horizontal, flat line, since there's no vertical change at all as x increases. Slope is often described informally as "rise over run" — how much a line rises (or falls) vertically for every unit it runs horizontally.
The equation y = mx + b is called slope-intercept form because it directly shows both key features of a line: m is the slope, and b is the y-intercept — the point where the line crosses the vertical y-axis (where x = 0). Once you know both values, you can graph the line by plotting the y-intercept first, then using the slope to find a second point (for example, a slope of 2 means moving right 1 unit and up 2 units from the intercept). This form is one of the most useful ways to describe a line because it makes both the line's behavior and its graph immediately readable from the equation itself.
Two lines are parallel if and only if they share the exact same slope — they rise and fall at the same rate and therefore never intersect, no matter how far they're extended. Two lines are perpendicular if their slopes are negative reciprocals of each other — meaning if one line has a slope of 2, a line perpendicular to it has a slope of −1/2 (flip the fraction and change the sign). This relationship is commonly used in geometry problems that ask you to find a line perpendicular or parallel to a given line through a specific point, since knowing the required slope is the first step before applying the point-slope formula to build the full equation.
The straight-line distance between two points is calculated using the distance formula, d = √[(x2−x1)² + (y2−y1)²], which is really just the Pythagorean theorem applied to the horizontal and vertical differences between the two points. This connects directly to slope calculations, since both formulas use the same underlying differences (the "rise" and "run") between the two points — slope tells you the ratio of that rise to run, while distance tells you the actual straight-line length connecting them, treating rise and run as the two legs of a right triangle.
Besides slope-intercept form, point-slope form is another common way to write a line's equation, especially useful when you know the slope and just one point rather than the y-intercept directly. Point-slope form can always be rearranged into slope-intercept form with a bit of algebra, and both describe exactly the same line — the choice between them usually just comes down to which form is more convenient for the specific problem at hand.
What does an undefined slope mean? A vertical line has an undefined slope because the horizontal change (run) between any two points on it is zero, and division by zero isn't defined — this calculator will flag this case as an error rather than returning a number.
Can slope be negative and still describe a normal line? Yes — a negative slope simply means the line trends downward as you move from left to right, which is a completely standard and common case, not an error or unusual result.
How is the angle of a line calculated from its slope? The angle from horizontal equals the arctangent (inverse tangent) of the slope value, since slope itself represents the tangent of that angle in a right-triangle relationship between rise and run.
Can I use this calculator for 3D coordinates? No — this tool works specifically with two-dimensional (x, y) coordinates on a standard Cartesian plane. Three-dimensional line calculations require a different, more complex set of formulas.
What if both my points have the same x-coordinate? That describes a vertical line, which has an undefined slope, since the run between the points is zero.
Does the order I enter the two points matter? No — swapping which point is entered first and which is entered second gives the same slope value, since both the rise and run flip sign together, canceling out.
Why is slope sometimes called a 'rate of change'? Because it describes how much the y-value changes for each unit change in x — the same underlying concept as a rate of change in calculus and physics, just applied to a straight line.
Last reviewed by Mehmed on July 11, 2026.