Distance from Point to Line Calculator

Enter a line equation (in slope-intercept, standard, or two-point form) and a point's coordinates to calculate the perpendicular distance from the point to the line. The Distance from Point to Line Calculator returns the exact distance value along with the foot of the perpendicular, so you can verify your geometry work in seconds.

Coefficient of x in Ax + By + C = 0

Coefficient of y in Ax + By + C = 0

Constant term in Ax + By + C = 0

Slope in y = mx + b

Y-intercept in y = mx + b

Results

Perpendicular Distance

--

Line in Standard Form

--

Foot of Perpendicular — X

--

Foot of Perpendicular — Y

--

|Ax₀ + By₀ + C|

--

√(A² + B²)

--

Frequently Asked Questions

What is the formula for the distance from a point to a line?

For a line in standard form Ax + By + C = 0 and a point (x₀, y₀), the perpendicular distance is d = |Ax₀ + By₀ + C| / √(A² + B²). This formula gives the shortest (perpendicular) distance between the point and the line, which is always a non-negative value.

How do I convert slope-intercept form (y = mx + b) to standard form for this calculation?

Rearrange y = mx + b to mx − y + b = 0. In standard form terms, A = m, B = −1, and C = b. This calculator handles this conversion automatically when you select the slope-intercept input mode.

What is the foot of the perpendicular?

The foot of the perpendicular is the specific point on the line that is closest to your given point. It is found by dropping a perpendicular from your point to the line. Its coordinates are computed as x_f = (B(Bx₀ − Ay₀) − AC) / (A² + B²) and y_f = (A(Ay₀ − Bx₀) − BC) / (A² + B²).

What does it mean when the distance is zero?

A distance of zero means the point lies exactly on the line. Substituting the point's coordinates into the line equation Ax₀ + By₀ + C yields zero, confirming the point satisfies the line equation perfectly.

Can I use this calculator for 3D point-to-line distance?

This calculator handles 2D geometry (lines in the xy-plane). For 3D distance from a point to a line, a different formula involving cross products of direction vectors is used. Many online tools, such as onlinemschool.com, provide dedicated 3D calculators for that purpose.

Why is the perpendicular distance considered the 'true' distance from a point to a line?

The perpendicular distance is the shortest possible distance from the point to any point on the line. Any other path from the point to the line would be longer. In mathematics, when we say 'distance from a point to a line,' we always mean this minimum, perpendicular distance.

How do I enter a vertical line like x = 5 into this calculator?

A vertical line x = 5 can be written in standard form as 1·x + 0·y − 5 = 0, so enter A = 1, B = 0, C = −5. The distance from a point (x₀, y₀) to a vertical line x = k is simply |x₀ − k|, which this calculator will compute correctly.

What happens if both A and B are zero?

If both A and B are zero, the equation 0x + 0y + C = 0 does not define a valid line (it's either always true or always false depending on C). The calculator guards against this case and will not produce a meaningful result — make sure at least one of A or B is non-zero.

More Math Tools