🔍

📐 Distance from a Point to a Line Calculator

Enter a line in the form Ax + By + C = 0 and a point’s coordinates to find the shortest distance from the point to the line.

What does this calculator find?

This calculator finds the shortest possible distance between a point and a straight line — the length of the perpendicular segment connecting them, which is always shorter than any other path from the point to the line.

The formula

For a line written in the general form Ax + By + C = 0 and a point (x0, y0), the distance is: Distance = |A·x0 + B·y0 + C| ÷ √(A² + B²). The numerator measures how far off the point is from satisfying the line’s equation, and dividing by √(A² + B²) converts that into an actual perpendicular distance.

If both A and B are zero, the input doesn’t describe a valid line, so this calculator returns zero rather than an undefined result.

This calculator is for general educational and reference purposes.

Last reviewed August 2026