Skip to content
Geometry

Perpendicular Line Calculator

Perpendicular Line Calculator

Give the tool a line and a point, and it hands back the line through that point that meets the first one at a right angle — the perpendicular slope, both equation forms, and the distance between the point and the line.

1 · The given line

The two points must be different — one point does not fix a line.

For the line written as y = mx + b.

2 · The point

The perpendicular line will pass through this point. It may sit on the given line or anywhere else.

Two lines that cross at exactly 90 degrees show up everywhere: the corner of a foundation, the grid of a city map, the axes of a graph. When you know one line and a point, finding the line through that point that meets the first at a right angle is one of the handiest constructions in geometry.

The Perpendicular Line Calculator does that construction for you. Describe the given line with two points or with a slope and y-intercept, enter the point your new line must pass through, and it returns the perpendicular slope, the new line's equation in both slope-intercept and standard form, and the distance from the point to the given line.

This guide explains the perpendicular slope rule, shows how to describe your line two ways, and works through four examples — including the horizontal and vertical cases that trip people up.

What "Perpendicular Line" Means

Two lines are perpendicular when they meet at a right angle — 90 degrees, the corner of a square. On a graph, that relationship is entirely captured by the two slopes: flip one and change its sign, and you get the other.

Perpendicular does not mean merely crossing. Lines can cross at 30 degrees or 120 degrees without being perpendicular; the right angle is the whole definition.

It also does not require the lines to touch in your drawing. Line segments can be perpendicular in direction even when the segments themselves never meet — the infinite lines they lie on still cross at 90 degrees, and that is what the slope rule tests.

The Perpendicular Slope Rule

If the given line has slope m, the perpendicular line has slope −1 ÷ m — the negative reciprocal. A slope of 3 gives −1/3; a slope of −2 gives 1/2; a slope of 1/2 gives −2.

m⊥ = −1 ÷ m

Two edge cases need care: a horizontal line has slope 0, so its perpendicular is vertical with an undefined slope, and a vertical line's perpendicular is horizontal with slope 0. The calculator handles both directly.

Defining the Given Line Two Ways

The calculator accepts the given line either as two points on it or as a slope and y-intercept. Two points suit measurements taken in the field; slope-intercept suits equations copied from a textbook.

From two points (x1, y1) and (x2, y2), the slope is rise over run:

m = (y2 − y1) ÷ (x2 − x1)

The two points must be different — one point does not determine a line.

The Point Your New Line Passes Through

The point (x0, y0) anchors the answer: infinitely many lines are perpendicular to the given one, and the point picks out exactly one of them. It can sit on the given line or far away from it.

With the perpendicular slope m⊥ and the point, the point-slope form gives the equation, which the calculator rearranges for you:

y − y0 = m⊥(x − x0)

Worked Example: Perpendicular Through (2, 5) to y = 3x + 1

The given line is y = 3x + 1, so m = 3, and the point is (2, 5).

The perpendicular slope is −1 ÷ 3 = −0.3333. Plugging into point-slope form: y − 5 = −0.3333(x − 2), which simplifies to y = −0.3333x + 5.6667.

In standard form that is −0.3333x − y = −5.6667. The distance from (2, 5) to the line is |3(2) − 5 + 1| ÷ √10 = 2 ÷ 3.1623 = 0.6325 units.

Worked Example: Line Through Two Points, Point Off the Line

The given line passes through (1, 2) and (4, 8); the point is (0, 1).

Slope: (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2. Perpendicular slope: −1 ÷ 2 = −0.5. Through (0, 1) the equation is y = −0.5x + 1, or −0.5x − y = −1 in standard form.

Distance: |6(0) − 3(1) + 4(2) − 8(1)| ÷ √45 = 3 ÷ 6.7082 = 0.4472 units.

Worked Example: Horizontal and Vertical Lines

The given line passes through (0, 3) and (5, 3) — a horizontal line with slope 0. The point is (2, 7).

A horizontal line's perpendicular is vertical, so the answer is simply x = 2, with an undefined perpendicular slope. The distance from the point to the line is |7 − 3| = 4 units.

Flip it around: given a vertical line, the perpendicular through any point is horizontal — y equals the point's y-coordinate.

Worked Example: A Negative Slope Case

The given line is y = −2x + 4 and the point is (1, 1).

Perpendicular slope: −1 ÷ (−2) = 0.5. The equation through (1, 1) is y − 1 = 0.5(x − 1), or y = 0.5x + 0.5.

Standard form: 0.5x − y = −0.5. Distance: |−2(1) − 1 + 4| ÷ √5 = 1 ÷ 2.2361 = 0.4472 units.

Slope-Intercept Form of the Answer

Slope-intercept form, y = mx + b, is the friendliest way to read a line: the slope tells you the tilt and the intercept tells you where it crosses the y-axis. The calculator always presents the perpendicular line this way first.

Because the line is forced through your point, the intercept is whatever value makes the equation true at (x0, y0) — it is computed, never guessed.

A quick way to verify the answer by hand: plug your point's x-coordinate into the equation and confirm you get its y-coordinate back. If (2, 5) does not satisfy y = −0.3333x + 5.6667, the arithmetic slipped somewhere.

Standard Form of the Answer

Standard form writes the same line as Ax + By = C. It is the form many textbooks and CAD tools prefer, and it handles every line uniformly.

The calculator rearranges its slope-intercept answer into this shape automatically, so you can copy whichever form your homework or software expects.

Distance From the Point to the Line

The shortest distance from a point to a line is measured along — you guessed it — the perpendicular. The calculator reports this number because it is the same construction, for free.

For a line y = mx + b the distance is |mx0 − y0 + b| ÷ √(m2 + 1). For a line through two points, an equivalent formula uses the point differences. Either way, the perpendicular foot is the closest point on the line.

Why the Slopes Multiply to Negative One

The negative reciprocal rule is not a coincidence: rotating a line by 90 degrees swaps rise and run and flips one sign, which turns m into −1/m. Multiplying the two slopes therefore always gives −1.

This gives you a one-second check on any answer: multiply the given slope by the perpendicular slope. If the product is not −1, something went wrong.

Perpendicular Lines in Construction and Design

Carpenters check corners with the 3-4-5 triangle, which is the Pythagorean theorem enforcing a right angle. Surveyors lay out perpendicular offsets from a baseline the same way the calculator does — a line, a point, a right angle.

In design software, snapping a wall perpendicular to another wall is this exact calculation running silently under the cursor.

Even sports use it: a soccer penalty spot sits on the perpendicular bisector of the goal line, and the arc the players wait behind is drawn with a fixed radius from that spot. Anywhere a right angle must be exact rather than eyeballed, this construction is doing the work.

Rounding and Exact Fractions in Your Answer

Slopes like −1/3 never end as decimals, so the calculator rounds displayed values to four decimal places. Four places are plenty for plotting and homework, and the underlying arithmetic keeps full precision until the final display.

When an exact fraction matters, convert the decimal yourself: −0.3333 is −1/3, 0.5 is 1/2. The companion Perpendicular Slope Calculator shows the exact fraction form directly.

Common Mistakes With Perpendicular Lines

The classic error is forgetting the negative: the perpendicular to slope 2 is −1/2, not 1/2. The sign flip is half the rule.

The other classic error is feeding the calculator the point as part of the line — the two points that define the given line and the point the answer passes through are three separate inputs with three separate jobs.

How to Use the Calculator Step by Step

First describe the given line: pick "two points" and enter both, or pick "slope and intercept" and enter m and b. Then enter the point (x0, y0) the perpendicular line must pass through.

Press Calculate to see the given slope, the perpendicular slope, the new equation in both forms, and the point-to-line distance. Reset clears the board for the next problem.

If you change the line-description dropdown after calculating, the old answer clears automatically — re-enter the fields for the newly shown option and calculate again. The error line under the buttons explains exactly which input needs attention.

Frequently Asked Questions

1. What does the Perpendicular Line Calculator do?

It finds the equation of the line through your point that meets a given line at a right angle. It also reports both slopes, the answer in slope-intercept and standard form, and the distance from the point to the given line.

2. What is the perpendicular slope rule?

If a line has slope m, any perpendicular line has slope −1 ÷ m, the negative reciprocal. The two slopes always multiply to −1.

3. How do I describe the given line?

Either enter two points on the line or enter its slope m and y-intercept b. Both describe the same line; pick whichever matches the information you have.

4. What if my line is horizontal?

A horizontal line has slope 0, so its perpendicular is vertical: x equals your point's x-coordinate. The calculator returns this directly, with the perpendicular slope shown as undefined.

5. What if my line is vertical?

A vertical line's perpendicular is horizontal: y equals your point's y-coordinate, and the perpendicular slope is 0. Enter vertical lines with the two-points option.

6. Can the point be on the given line?

Yes. The perpendicular through a point on the line is the line that crosses it at a right angle there, and the distance reported will be 0.

7. What is standard form?

Standard form writes a line as Ax + By = C. It is algebraically equivalent to slope-intercept form and is the format many textbooks and CAD tools expect.

8. How is the distance calculated?

Distance is measured along the perpendicular — the shortest path. For y = mx + b it is |mx0 − y0 + b| ÷ √(m2 + 1); the two-point version uses an equivalent formula.

9. Why do the slopes multiply to −1?

Rotating a line 90 degrees swaps its rise and run and flips one sign, turning m into −1/m. Multiplying m by −1/m gives −1 for every non-zero slope.

10. Why must the two points be different?

One point does not determine a line; infinitely many lines pass through a single point. Two distinct points pin the direction down exactly.

11. How many decimals should I keep?

The calculator shows four, which is plenty for graphing and homework. For exact work, convert repeating decimals like −0.3333 back to fractions such as −1/3.

12. What does "undefined slope" mean?

It means the line is vertical: x never changes, so rise over run divides by zero. Vertical lines are perpendicular to horizontal lines.

13. Can I use fractions as inputs?

Enter them as decimals — 1/2 as 0.5, −1/3 as −0.3333. The four-decimal display keeps the rounding error tiny.

14. Is the perpendicular line unique?

Yes, once the point is fixed. Infinitely many lines are perpendicular to a given line, but only one of them passes through your point.

15. Where are perpendicular lines used?

Framing square corners, surveying offsets, road intersections, graph axes, and CAD snapping all rely on the same right-angle construction this calculator performs.