Angle Between Two Lines Calculator

Enter the slope of each line to find the angle between them.

How it is calculated

Each slope is the rise over run of a line, m = Δy / Δx, a plain number with no unit. The tool computes tan θ = |(m1 − m2) / (1 + m1·m2)| and then θ = arctan(tan θ), shown in degrees to three decimals. If 1 + m1·m2 is zero the lines are perpendicular and the angle is reported as 90°. Equal slopes give 0° and are labelled parallel. A second figure, the acute angle, is the smaller of θ and 180° − θ. Both slopes must be filled in, otherwise no result appears. A vertical line has no finite slope, so it cannot be entered.

Worked example

Take two lines with slopes m1 = 3 and m2 = 1. The numerator is 3 − 1 = 2 and the denominator is 1 + 3·1 = 4, so tan θ = |2 / 4| = 0.5. Then θ = arctan(0.5), which gives an angle of 26.565°. Because that is already below 90°, the acute angle is the same 26.565°. Since the denominator is not zero and the slopes differ, the note says the lines are intersecting.

Try this example →

Common mistakes

  • Typing the angle of inclination in degrees (for example 45) instead of the slope. A 45° line has slope 1, so enter 1.
  • Forgetting the absolute value and expecting a negative angle: the result is always between 0° and 90°, whichever line you call m1.
  • Entering a vertical line as a very large number. It works approximately, but a vertical line has no slope, so use a different method for it.
  • Mixing up the slope with the y-intercept in y = mx + b. Only the coefficient m of x goes in.
  • Rearranging an equation like 2y = 6x + 1 without dividing by 2 first. The slope there is 3, not 6.

About this calculator

When two straight lines are described by their slopes m1 and m2, the angle between them can be found without ever drawing a diagram, using tan θ = the absolute value of (m1 − m2) divided by (1 + m1·m2). The formula falls directly out of the tangent subtraction identity applied to each line's angle of inclination, and it correctly returns zero for parallel lines (equal slopes). For perpendicular lines 1 + m1·m2 equals zero, so the tangent formula itself is undefined, but the angle is simply 90°, which is what this calculator reports.

This calculator takes the two slopes and returns the angle between the lines they represent, along with the acute angle and a note saying whether the lines are parallel, perpendicular, or intersecting. It's a standard tool in coordinate geometry and trigonometry courses, and the same relationship is used in fields like surveying, CAD drafting, and engineering drawing whenever the angle between two linear features needs to be derived from their gradients rather than measured directly.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The tool cannot take a vertical line, but you can still handle one by hand: the angle between a vertical line and a line with slope m is 90 degrees minus arctan of the absolute value of m. For slope 1 that gives 45 degrees. The result is always between 0 and 90 degrees, so it is the smaller of the two angles the lines make. Do you usually start from slopes, equations or two points on each line?

Popular calculators

All Calculators