Logo

MonoCalc

/

Slope Calculator

Geometry

Point 1 (x₁, y₁)

x₁

y₁

Point 2 (x₂, y₂)

x₂

y₂

Optional: Third Point for Collinearity Check

x₃

y₃

ΔyΔxAB

Slope (m)

2

Rising

Line Equation

y = 2x - 1

Rise (Δy)

8

Run (Δx)

4

Y-Intercept (b)

-1

Angle of Inclination

63.4349°

Percent Grade

200%

Perpendicular Slope

-0.5

About This Tool

Slope Calculator – Gradient, Angle, and Line Equation

The slope of a line (also called gradient) measures how steeply a straight line rises or falls between two points on a coordinate plane. This calculator accepts two coordinate pairs and instantly computes the slope, the full slope-intercept equation, the angle of inclination, the percent grade, and whether a third optional point is collinear with the first two.

The Slope Formula

Given two points P₁(x₁, y₁) and P₂(x₂, y₂), the slope m is defined as:

m = (y₂ − y₁) / (x₂ − x₁) = rise / run

The numerator y₂ − y₁ is the rise — the vertical change between the two points. The denominator x₂ − x₁ is the run— the horizontal change. Together they form the familiar rise-over-run ratio.

A positive slope means the line rises from left to right. A negative slope means it falls. A slope of zero means the line is perfectly horizontal, and when x₁ = x₂ the slope is undefined because division by zero is not possible — the line is vertical.

Slope-Intercept Form of a Line

Once the slope is known, the full line equation can be derived. The most common form is the slope-intercept form:

y = mx + b

where m is the slope and b is the y-intercept— the point where the line crosses the y-axis. The y-intercept is calculated as:

b = y₁ − m × x₁

This form is the most versatile because it lets you find y for any value of x by simple substitution.

Angle of Inclination

The angle of inclination θ is the angle the line makes with the positive x-axis, measured counterclockwise in degrees:

θ = arctan(m) × (180 / π)

Results range from −90° (a nearly vertical falling line) to +90° (a nearly vertical rising line). A slope of 1 produces an angle of exactly 45°. A slope of 0 gives 0° (horizontal). The angle is useful in trigonometry, physics (ramp problems), and surveying.

Percent Grade

Percent grade expresses slope as a percentage, commonly used in road design, ramp engineering, and construction:

grade (%) = m × 100

A slope of 0.08 equals an 8% grade: the road rises 8 metres for every 100 metres of horizontal distance. Building codes for accessible ramps typically cap the grade at 8.33% (1:12 ratio). Highway design guidelines generally target grades below 6–8% for safety at speed.

Parallel and Perpendicular Lines

Two lines are parallel if and only if their slopes are equal. They are perpendicular if their slopes multiply to −1. Given slope m, the perpendicular slope is −1 / m. The calculator displays the perpendicular slope so you can immediately check or construct a right-angle intersection.

Collinearity of Three Points

Three points are collinear (they lie on the same straight line) when the area of the triangle they would form equals zero. The calculator checks this using the signed triangle area formula:

Area × 2 = x₁(y₂ − y₃) + x₂(y₃ − y₁) + x₃(y₁ − y₂)

If this value is zero (within a floating-point tolerance of 1 × 10⁻⁹), the three points are collinear. Enter optional coordinates for a third point to activate this check.

Slope as a Fraction

When the slope is not a whole number, the calculator also displays the slope as a reduced fraction. For example, a slope of 0.75 appears as 3/4. Fractional representation is produced by applying the Euclidean GCD algorithm to the rise and run values and reducing to lowest terms. This is particularly helpful in algebra and geometry classes where fractional slopes are preferred.

How to Use the Calculator

Enter the x and y coordinates for Point 1 and Point 2. Results update instantly as you type — no button press required. The coordinate diagram shows the two points, the line through them, and the rise/run triangle to help visualise the gradient. Use the optional third point fields to check collinearity. Click Show Step-by-Step to reveal the full substituted formula, and use the copy buttons next to each result to copy individual values to your clipboard.

Common Applications

Slope calculations appear in algebra courses (graphing linear equations), calculus (instantaneous rate of change as a limit), physics (velocity from position-time graphs, incline angle), civil engineering (road grades, drainage design), construction (roof pitch, accessible ramp design), anddata science (linear regression coefficients). Understanding slope is foundational to virtually every branch of mathematics and applied science.

Frequently Asked Questions

Is the Slope Calculator free?

Yes, Slope Calculator is totally free :)

Can I use the Slope Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Slope Calculator?

Yes, any data related to Slope Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does the Slope Calculator work?

Enter the X and Y coordinates of two points (x₁, y₁) and (x₂, y₂). The calculator instantly computes the slope m = (y₂ − y₁) / (x₂ − x₁), the line equation y = mx + b, the angle of inclination in degrees, the percent grade, and whether a third optional point is collinear with the first two. Results update in real time as you type.

What is slope and what does it mean?

Slope (also called gradient) measures the steepness and direction of a straight line. A positive slope means the line rises from left to right; a negative slope means it falls. A slope of 0 is horizontal, and an undefined slope indicates a vertical line. Numerically, slope equals the rise (vertical change) divided by the run (horizontal change).

What happens when the two X coordinates are equal?

When x₁ = x₂, the run (Δx) is zero, making division impossible. The slope is mathematically undefined — the line is perfectly vertical. The calculator detects this automatically and displays 'Vertical (undefined slope)' along with the equation x = x₁ instead of the usual y = mx + b form.

What is the angle of inclination and how is it calculated?

The angle of inclination θ is the angle the line makes with the positive X-axis, measured in degrees. It is computed using the inverse tangent: θ = arctan(m) × (180 / π). The result ranges from −90° (nearly vertical, falling) to +90° (nearly vertical, rising), with 45° for a slope of 1 and 0° for a horizontal line.

What is percent grade and where is it used?

Percent grade expresses slope as a percentage: grade = m × 100%. A slope of 0.08 is an 8% grade, meaning 8 units of rise per 100 units of run. This measure is standard in road design, ramp engineering, and construction. Steep roads typically have grades between 6% and 10%, while accessible ramps must not exceed about 8.3%.

How accurate are the calculations?

All calculations use JavaScript's 64-bit IEEE 754 floating-point arithmetic, providing approximately 15–16 significant decimal digits — more than sufficient for engineering, science, and education. The collinearity check uses a tolerance of 1 × 10⁻⁹ to avoid floating-point false negatives for near-collinear points.