Free tool
Parallel and perpendicular lines calculator, any equation, with a graph.
Type a line in any form, or two points, and a point to get the parallel line and the perpendicular line through it, in slope-intercept and standard form, with the distance from the point to the line and the foot of the perpendicular. Or type two lines or two slopes to see if they are parallel, perpendicular, the same or neither, where they cross and the angle between them. You can also paste a list of lines to find every parallel and perpendicular pair, or find the perpendicular bisector of a segment.
Need a custom tool, app or website? Contact us →What to do
Type undefined for a vertical line.
Type a line like y = 2x + 1, 3x − 2y = 6, x = 4 or y − 3 = 2(x − 1). You can also type two points, like (1, 2) and (3, 5), or slope 2 through (1, 3). Fractions such as 1/2 work.
Worked out in your browser. Nothing is sent anywhere.
Guide
How to find parallel and perpendicular lines, with worked examples.
A parallel and perpendicular line calculator finds the lines that run alongside, or at a right angle to, a line you already have. Type your line in any form and a point, and you get the parallel line through that point and the perpendicular line through it, both in slope-intercept and standard form, with the distance from the point to the line and the nearest point on it. Or type two lines to find out whether they are parallel, perpendicular, the same or neither.
How to use it
- Choose Line through a point, Compare two lines, Compare two slopes, Find pairs in a list or Perpendicular bisector.
- Type your line in Your line (any form). Slope-intercept (y = 2x + 1), standard (3x − 2y = 6), point-slope (y − 3 = 2(x − 1)) and vertical (x = 4) all work. So do two points, like (1, 2) and (3, 6), and a slope with a point, like slope 2 through (1, 3).
- Type the Point x and Point y the new lines must pass through.
- Read the two big cards, then the distance and the nearest point. The graph draws your line, the parallel and the perpendicular in different colours, and Steps shows the working.
The two rules
Parallel lines have the same slope. Perpendicular lines have slopes whose product is −1, so one is the negative reciprocal of the other: slope 2 pairs with −1/2, and slope −3/4 pairs with 4/3. Two special cases break the pattern. A horizontal line (slope 0) is perpendicular to a vertical line, which has no slope. Because of that, the calculator also uses the form Ax + By = C, where a parallel line only changes C and a perpendicular line swaps A and B and flips one sign.
Worked example: line y = 2x + 1 and the point (3, 4)
The slope is 2. The parallel line keeps slope 2 and passes through (3, 4): y − 4 = 2(x − 3), so y = 2x − 2. The perpendicular slope is −1 ÷ 2 = −1/2, so y − 4 = −1/2 (x − 3), which is y = −x/2 + 11/2, or x + 2y = 11 in standard form. To measure how far the point is from the line, write the line as 2x − y = −1 and use |Ax₀ + By₀ − C| ÷ √(A² + B²) = |6 − 4 + 1| ÷ √5 = 3 ÷ √5 = 1.3416. The nearest point on the line is where the perpendicular meets it: (9/5, 23/5).
Worked example: standard form and a negative point
For 3x − 2y = 6 and the point (−2, 5), the slope is −A ÷ B = 3/2. The parallel line is y − 5 = 3/2 (x + 2), so y = 3x/2 + 8. The perpendicular slope is −2/3, so y − 5 = −2/3 (x + 2), which is y = −2x/3 + 11/3.
Compare two lines
Type y = 2x + 1 and 2x − y = 7. Both have slope 2 and different intercepts, so they are parallel. Their distance apart, once both are written with the same A and B, is |C₁ − C₂| ÷ √(A² + B²) = 8 ÷ √5 = 3.5777. Type y = 2x + 1 and x + 2y = 3 and the slopes are 2 and −1/2, which multiply to −1, so they are perpendicular and cross at (1/5, 7/5). For lines that are neither, the page gives the sharper angle between them and the crossing point.
Compare two slopes
When a question gives only slopes, use Compare two slopes. Slopes 2/3 and −3/2 multiply to −1, so the lines are perpendicular. Slopes 1/2 and 2 give a product of 1, not −1, so the lines are neither parallel nor perpendicular, and the angle between them is 36.87°. Type the word undefined for a vertical line: it is perpendicular to slope 0 and parallel to another vertical line. The page also shows the negative reciprocal of each slope.
Find pairs in a list
Geometry homework often lists several lines and asks which are parallel and which are perpendicular. Type one line on each row, up to eight, and the page compares every pair. For y = 2x + 1, 2x − y = 7, x + 2y = 4 and y = −x/2 + 3, lines 1 and 2 are parallel (slope 2), lines 3 and 4 are parallel (slope −1/2), and each of the first two is perpendicular to each of the last two. A table gives the result, the crossing point and the angle for each pair.
Perpendicular bisector of a segment
The perpendicular bisector of the segment from A to B cuts it in half at a right angle, and every point on it is the same distance from A and B. For A = (1, 2) and B = (7, 6) the midpoint is (4, 4) and the slope of AB is 2/3. The bisector has slope −3/2 and passes through (4, 4), so y = −3x/2 + 10, or 3x + 2y = 20. If AB is vertical the bisector is horizontal, and the other way round.
Common problems
- A line with no slope. A vertical line like x = 4 has no slope. The parallel is another vertical line and the perpendicular is horizontal.
- The point is on the line. The parallel line is then the same line, the distance is 0 and the page says so.
- Not a straight line. An equation with x² or x times y is not a line, and the page asks for one that is.
To find a slope from two points, use the slope calculator. To find the middle of a segment and its length, use the midpoint and distance calculator. To draw lines together, try the graphing calculator.
Questions
Good to know.
How do I find a line parallel to another line?
Keep the same slope and use your point to find the new intercept. For y = 2x + 1 through (3, 4), the parallel line is y = 2x − 2.
How do I find a line perpendicular to another line?
Use the negative reciprocal of the slope. The perpendicular to slope 2 has slope −1/2. Then use your point in point-slope form.
What is the negative reciprocal?
Flip the fraction and change the sign. The negative reciprocal of 3/4 is −4/3, and of −5 is 1/5. Two slopes that are negative reciprocals multiply to −1.
Are vertical and horizontal lines perpendicular?
Yes. A horizontal line has slope 0 and a vertical line has no slope, so the product rule does not apply, but the two lines do meet at a right angle.
How do I check if two lines are parallel from standard form?
For Ax + By = C, lines are parallel when A₁B₂ − A₂B₁ = 0, and perpendicular when A₁A₂ + B₁B₂ = 0. The compare option shows both numbers.
What is the distance from a point to a line?
It is the length of the perpendicular from the point to the line: |Ax₀ + By₀ − C| ÷ √(A² + B²) for the line Ax + By = C.
Can the two lines be the same line?
Yes, if one equation is a multiple of the other, such as y = 2x + 1 and 4x − 2y = −2. The page says the same line instead of parallel.
Can I type two points instead of an equation?
Yes. Type the points in brackets, like (1, 2) and (3, 6), where the line is asked for. You can also type a slope and a point, like slope 2 through (1, 3).
How do I find a perpendicular bisector?
Find the midpoint of the segment, take the negative reciprocal of its slope, and write the line through the midpoint. The Perpendicular bisector option does all three and shows the length too.
How is this different from the slope calculator?
The slope calculator starts from two points and gives the slope, angle, intercepts and the line. This page starts from a line you already have and finds what is parallel or perpendicular to it, or compares lines.