Equation of a Line and Slope Calculator
Choose how the line is described, then enter the numbers. You get y = mx + c, the standard form, the slope as an angle and a percentage grade, both intercepts, and the slope of a line at right angles.
Worked examples
From two points
(1, 2) and (3, 8)
y = 3x - 1, or 3x - y = 1
The slope is 6 ÷ 2 = 3, and the angle is about 71.57 degrees.
A gentle slope
Slope 0.125
12.5% grade, 7.1 degrees
The angle is the inverse tangent of 0.125.
About Equation of a Line and Slope Calculator
A straight line can be written in several ways. Slope-intercept form is y = mx + c, where m is the slope and c is where the line crosses the y axis. Standard form is Ax + By = C, usually with whole numbers. Point-slope form is y - y₁ = m(x - x₁). The slope is the rise divided by the run: a slope of 2 goes up two for every one across, a negative slope goes downhill, and a vertical line has no slope at all.
Enter two points, a point and a slope, or a general equation, and the page gives all the forms using exact fractions. It also finds where the line crosses each axis, the slope of a line at right angles, which is the negative reciprocal, the angle the line makes with the horizontal and the percentage grade used for roads and ramps. From two points you also get the rise, the run and the distance between them. A slope of 0.125 is a 12.5% grade and an angle of about 7.1 degrees.
How to use Equation of a Line and Slope Calculator
- Choose how the line is described: two points, a point and a slope, or an equation.
- Fill in the boxes that appear. Fractions such as 2/3 are fine.
- Read the slope and the equation in the large boxes.
- Use the table for the other forms, intercepts, angle, grade and the perpendicular slope.
Common uses
- Writing the equation of a line in coordinate geometry
- Finding the gradient and percentage grade of a ramp or road
- Converting between slope-intercept and standard form
- Finding the line at right angles to another
Frequently asked questions
How do I find the slope between two points?
Divide the change in y by the change in x. From (1, 2) to (3, 8) the slope is (8 - 2) ÷ (3 - 1), which is 3.
What does a slope of zero or an undefined slope mean?
A slope of zero is a flat, horizontal line. An undefined slope belongs to a vertical line, where the run is zero and you cannot divide by it.
How do I turn the slope into a percentage grade?
Multiply it by 100. A slope of 0.1 is a 10% grade. The angle is the inverse tangent of the slope.
How do I find a line at right angles?
Its slope is the negative reciprocal of the slope of the original line. If the original slope is 3, the line at right angles has a slope of -1/3.
What is the y intercept?
It is the value of y where the line crosses the y axis, when x is 0. In y = 3x - 1 it is -1.