Perpendicular Line Calculator: The Slope and the Equation
Give a slope, an equation or two points, and a point to pass through. You get the perpendicular line and the parallel line, both written out, with fractions kept as fractions. Horizontal and vertical lines are handled properly instead of being refused.
How to use the perpendicular line calculator
- From a Slope. The slope box takes more than a number. Type a slope such as
2or-2/3, or paste the line itself:y = 2x + 3,3x + 4y = 12,y = 5,x = 4. For a vertical line you can also just typeundefined. - Two Points. Give two points the original line passes through and the slope is worked out first.
- Through x and Through y are the point the new line has to pass through. Leave them empty and the line is placed through the origin.
What you get back
- The perpendicular line, written in point slope form and solved for y. Most people searching for the perpendicular slope actually need the line, so it is printed without asking.
- The parallel line through the same point, since the two are almost always set in the same question.
- Both slopes, with fractions kept as fractions. The negative reciprocal of a whole number is always a fraction, and a fraction is the form the answer key expects.
- A real answer for horizontal and vertical lines, rather than an error. See below, because this is the case most tools get wrong.
- The check, m × m⊥ = −1, written into the steps so you can see the answer verify itself.
The rule, and the one case where it breaks
For two lines that both have a slope, the rule is short. Parallel lines have the same slope. Perpendicular lines have slopes that multiply to −1, which is the same as saying each is the negative reciprocal of the other: flip the fraction and change the sign.
So a line with slope 2 has perpendicular slope −1/2. A line with slope −2/3 has perpendicular slope 3/2. Flip, then change sign, or change sign, then flip. The order does not matter and you get the same answer either way.
Then there is the pair the rule cannot touch. A horizontal line has slope 0. A vertical line has no slope at all, because working it out means dividing by a run of zero. They are perpendicular to each other, and you can see that on any graph, but the negative reciprocal rule cannot produce that answer: −1 divided by 0 is undefined, and there is no number to take the reciprocal of on the vertical side.
The rule and the exception together:
- Perpendicular to
y = 5through (2, 7) isx = 2. Slope undefined. - Perpendicular to
x = 4through (1, 3) isy = 3. Slope exactly 0. - Everything else uses the negative reciprocal.
This calculator answers both of those. It is worth checking whichever tool you normally use against them, because in our review of the calculators currently ranking for this search, carried out in August 2026, several would not take x = 4 as an input at all, and one returned its answer in a box that can only hold y = mx + b, a form that cannot express a vertical line even in principle.
Two things to keep straight. Undefined is not infinity. A vertical line does not have a slope of −∞ or +∞; it has no slope, because the calculation never produces a number. And 0 and undefined are not interchangeable: the most common wrong answer to “what is the slope perpendicular to a horizontal line” is 0, which is the slope of the horizontal line you started with.
Why the slopes multiply to −1
Take a line with slope m, and read it as a right triangle: move 1 across, rise m up. Now rotate that triangle a quarter turn. The side that pointed right now points up, and the side that pointed up now points left. The run of 1 has become a rise of 1, and the rise of m has become a run of −m.
The rotated line therefore has slope 1 ÷ (−m), which is −1/m. Multiply the two together and the m cancels: m × (−1/m) = −1.
The rotation is also why the exception exists. Rotate a horizontal line and you get a vertical one, and at that quarter turn the run becomes 0, so the division that defines slope has nothing to divide by. The geometry still works. Only the arithmetic runs out. The same negative reciprocal appears again in calculus as the normal line, which is the line perpendicular to a curve at a point and is printed by the slope of tangent line calculator.
Perpendicular to a line in standard form
Textbook questions often give the line as Ax + By = C rather than solved for y, and it is quicker than rearranging. The slope of Ax + By = C is −A/B, so the perpendicular slope is B/A.
For 3x + 4y = 12: the slope is −3/4, so the perpendicular slope is 4/3. Through the origin that gives y = (4/3)x. You can paste the standard form straight into the slope box above and skip the rearranging.
The edge case is worth knowing. If B = 0 the line is Ax = C, which is vertical, so the perpendicular is horizontal and B/A does not apply.
Fractions, signs, and where the marks get lost
Two slips account for most wrong answers here, and neither is conceptual.
- Losing the fraction. The perpendicular slope of 2 is −1/2, and a calculator that hands back −0.5 has given you extra work at best and a mark deduction at worst. This one keeps the fraction.
- Sign tracking on a slope that is already negative. Starting from −2/3: flip it to −3/2, then change the sign to get +3/2. Two negatives were involved and the answer is positive. Where both slopes are numbers and neither is zero, they always have opposite signs, so if both of yours came out negative, something went wrong. The horizontal and vertical pair sits outside this: 0 and undefined have no signs to compare.
Checking your answer
Multiply the two slopes. If both lines have a slope and the product is −1, they are perpendicular. If the product is anything else, they are not.
All of this assumes two straight lines. Perpendicular to a curve means perpendicular to the curve’s tangent at the point you care about, so the first job there is finding that tangent’s slope, which the tangent line calculator does; the negative reciprocal step afterwards is the same one as above.
If one of the lines is vertical the test does not apply, and you check it by looking instead: a vertical line is perpendicular to a horizontal one and to nothing else. The steps panel prints the multiplication whenever both slopes exist, so the check is already done for you.
Frequently asked questions
What is the slope of a line perpendicular to a horizontal line?
Undefined. A horizontal line has slope 0, and the line at right angles to it is vertical. A vertical line has no slope at all, because finding a slope means dividing the rise by the run and the run here is 0. The common wrong answer is 0, which is the slope of the horizontal line you started with, not of the perpendicular one.
What is the slope of a line perpendicular to a vertical line?
Exactly 0. The perpendicular to a vertical line is horizontal, and horizontal lines have slope 0. This is a real number, not an undefined one, so the two halves of this pair are not symmetric: perpendicular to horizontal gives undefined, perpendicular to vertical gives 0.
Do perpendicular lines always have negative reciprocal slopes?
No, and this is the exception worth remembering. It holds for every pair except a horizontal line with a vertical one, where one of the two has no slope to take a reciprocal of. The statement that is always safe is that the slopes multiply to −1 whenever both slopes exist.
Why is the perpendicular slope the negative reciprocal?
Rotate the slope triangle a quarter turn. A run of 1 with a rise of m becomes a rise of 1 with a run of −m, so the new slope is −1/m. Multiplying the two gives −1. The rotation also explains the exception: rotating a horizontal line gives a vertical one, and there the run becomes 0 and the division stops working.
How do I find the perpendicular slope of a fraction like 2/3?
Turn it upside down and change the sign, so 2/3 becomes −3/2. Keep it as a fraction. If the slope you start with is already negative, the answer comes out positive: −2/3 flips to −3/2 and then becomes +3/2.
What is the slope perpendicular to Ax + By = C?
The line Ax + By = C has slope −A/B, so the perpendicular slope is B/A. For 3x + 4y = 12 the slope is −3/4 and the perpendicular slope is 4/3. If B is 0 the line is vertical, so its perpendicular is horizontal with slope 0 and the B/A shortcut does not apply.
How can I tell if two lines are perpendicular from their equations?
Put both into y = mx + b, multiply the two slopes, and check for −1. If one equation is of the form x = a it is vertical, so it is perpendicular only to a line of the form y = b. Two lines being perpendicular has nothing to do with their intercepts, only their slopes.
Are negative reciprocal, opposite reciprocal and inverse the same thing?
Negative reciprocal and opposite reciprocal are two names for the same operation, and both are correct. Inverse on its own is not: the reciprocal of a number is 1 divided by it, with no sign change, and the inverse of a function is something else entirely. If a question says inverse when it means negative reciprocal, it is being loose with the word.
Does the order matter, flip then negate or negate then flip?
No. Both routes land on the same number, so use whichever you find easier to keep track of. What does matter is doing both steps: −1/m is not the same as −m, and forgetting the flip is the more common of the two mistakes.
What is the difference between a perpendicular line and a perpendicular bisector?
A perpendicular line meets the original at a right angle anywhere along it. A perpendicular bisector has to do two things: meet at a right angle and pass through the midpoint of a segment. So every perpendicular bisector is a perpendicular line, and most perpendicular lines are not bisectors.
How do I find a line perpendicular to the line through two points?
Use the Two Points tab. The slope through the two points is worked out first, then the perpendicular slope from that, then the equation through whichever point you give as the one to pass through. If the two points share the same x value the line through them is vertical, and the perpendicular is horizontal.
Can two perpendicular lines both have positive slopes?
No. Their slopes multiply to −1, which is negative, so one has to be positive and the other negative. The only pair that escapes this is a horizontal line with a vertical one, where one of them has no slope to have a sign.