Slope Calculator

The slope of a line describes how steeply it rises or falls as you move along the horizontal axis, and it is one of the most important properties of any straight line in coordinate geometry. Defined as rise divided by run, slope tells you how much the y-value changes for every one unit you move to the right along the x-axis. A slope of 3 means the line climbs three units for each unit of horizontal distance. A negative slope means the line falls. A slope of zero means the line is perfectly flat. An undefined slope indicates a vertical line. This calculator takes the coordinates of two points, (x1, y1) and (x2, y2), and returns the slope, the y-intercept, the x-intercept, and the full equation of the line in slope-intercept form (y = mx + b). It also classifies the line as rising, falling, horizontal or vertical. The slope is calculated as m = (y2 minus y1) / (x2 minus x1). Once you have the slope, the y-intercept follows from b = y1 minus m times x1, and the x-intercept is found by setting y to zero in the line equation. The default example uses (1, 2) and (3, 8), giving a slope of 3 and the line equation y = 3x minus 1. This tool is useful for students studying algebra and coordinate geometry, data analysts finding the gradient of a trend, and engineers or architects working with inclines and gradients. Results are for reference only.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner: Health Based Building
Advertise on this page
3
slope (gradient)
Y-intercept (b)-1
X-intercept0.33
Line equationy = 3x - 1
DirectionRising

How it works

The slope is m = (y2−y1)/(x2−x1). The y-intercept is b = y1 − m×x1, found by substituting either point into y = mx + b and solving for b. The x-intercept is the x value when y = 0: x = −b/m. The direction is rising if m > 0, falling if m < 0, horizontal if m = 0, and vertical if x1 = x2.

Worked example

Point 1 = (1, 2) and Point 2 = (3, 8) (the default values). Slope m = (8−2)/(3−1) = 6/2 = 3. Y-intercept: b = 2 − 3×1 = −1. X-intercept: x = −(−1)/3 = 0.33. Line equation: y = 3x − 1. The line is rising because the slope is positive.

Related calculators