How do I calculate slope?
Slope is rise over run: how much y changes for each step in x. For two points, slope m=(y2 - y1) / (x2 - x1). The default example uses points (1, 2) and (5, 10): rise=8, run=4, so the slope is exactly 2, the y-intercept is 0, and the equation is y=2x. The calculator shows the slope as a simplified fraction and a decimal, the angle the line makes (63.43 degrees here), the distance between the points (8.94), the midpoint (3, 6), and the perpendicular slope (-0.5). A positive slope climbs to the right, a negative slope falls, and zero is flat.
How do I find the equation of a line?
Once you have the slope, the intercept b comes from b=y1 - m x1, giving y=mx + b. The Sample button uses points (-2, 3) and (4, -1): rise=-4, run=6, slope=-⅔ (about -0.67), intercept 1.67, so the equation is y=-2/3x + 1.67. Fractions are kept exact when the coordinates are whole numbers, because -⅔ is more useful than a rounded decimal for further algebra. The distance between these points is 7.21 and the midpoint is (1, 1). To check an equation, substitute either point back in: -⅔ x 4 + 1.67=-1.0, which matches the second point.
What about vertical and horizontal lines?
A vertical line has x1=x2, so the run is zero and the slope is undefined (division by zero); the calculator says so plainly and gives the equation x=value instead, with a 90 degree angle. A horizontal line has slope 0 and equation y=value, and its perpendicular is vertical, so the perpendicular slope is undefined. Two identical points are rejected with a message, since infinitely many lines pass through one point. These edge cases matter in homework and in code, where an unhandled vertical line is a classic source of crashes.
Where is slope used in real life?
Roads and ramps: gradient signs are slopes, and accessibility rules cap ramp slope (often 1:12). Roofs: pitch is rise over run, deciding materials and drainage. Economics and data: the slope of a trend line is the rate of change, like cost per unit or temperature per decade. Physics: on a distance-time graph, slope is speed; on a velocity-time graph, slope is acceleration. Construction and landscaping use slope for drainage so water flows away from buildings. In each case the angle matters too, which is why the calculator converts slope to degrees: a slope of 2 is a steep 63.43 degrees, while 1/12 is a gentle 4.76 degrees.
How do parallel and perpendicular lines work?
Parallel lines have equal slopes and never meet. Perpendicular lines meet at 90 degrees, and their slopes multiply to -1, so the perpendicular slope is the negative reciprocal: for slope 2 it is -0.5, and for -⅔ it is 1.5. The calculator shows the perpendicular slope for every line. This pair of facts solves most coordinate-geometry problems: given a line and a point, the parallel line through the point reuses m, the perpendicular uses -1/m, and the intercept comes from substituting the point. Distance and midpoint, also shown, complete the standard toolkit for triangles and circles on the coordinate plane.
Is it free and private?
Yes. The slope calculator is free, with no signup, no account and no limits. Calculations run entirely in your browser, so your coordinates are never sent to a server, stored or logged. For students, teachers, engineers and anyone checking a gradient, this page does the job in seconds.