Point to Line Distance Calculator

Distance—
Numerator |Ax0 + By0 + C|—
Denominator √(A² + B²)—

How Point to Line Distance Calculator is calculated: Distance = |Ax0 + By0 + C| ÷ √(A² + B²), for line Ax + By + C = 0 and point (x0, y0)

What is the distance from a point to a line?

The distance from a point to a line is the shortest distance between them, and it is measured along the perpendicular from the point to the line. Any other path from the point to the line is longer, because the perpendicular is the shortest route to a straight line. The distance is always a positive number, and it is zero exactly when the point lies on the line. It is a basic measurement in coordinate geometry, in computer graphics and in engineering, wherever a point must be kept a known distance from a line.

This calculator finds that perpendicular distance from the line in the form Ax plus By plus C equals zero and the point (x0, y0), and it also shows the numerator and denominator of the formula separately. For the distance between two points, a distance calculator covers the same Pythagorean idea without the line.

Your figures stay on your own device because the whole calculation happens in the browser. Nothing is uploaded, nothing is stored, and there is no account to create. That makes it safe to try realistic numbers, including the ones you would not want to paste into a random website. It also means the tool works the same way on a phone, a tablet or a computer, with nothing to install.

How the point-to-line distance is calculated

The distance is the absolute value of A times x0 plus B times y0 plus C, divided by the square root of A squared plus B squared. The numerator measures how far the point is from satisfying the line equation: if the point lies on the line, the numerator is zero, and if it is far away, the numerator is large. The denominator normalises by the size of the coefficients, so that the same line written with different coefficients gives the same distance.

A, B and C are the coefficients of the line in the form Ax plus By plus C equals zero, and x0 and y0 are the coordinates of the point. A and B cannot both be zero, because then there is no line at all. The coefficients can be scaled by any nonzero number without changing the line, and the formula gives the same distance, because the numerator and denominator scale together.

The distance is the headline number, in the same unit as the coordinates, and it is the length of the perpendicular from the point to the line. The numerator is the absolute value of the line equation evaluated at the point, and the denominator is the length of the normal vector (A, B), which is the direction perpendicular to the line. The two rows let you check the calculation step by step.

The results are rounded for display, usually to two decimal places, while the calculation itself keeps full precision. That means a figure shown as 12.41 percent may be 12.405 percent underneath, and using the displayed figure in a further calculation can introduce a small rounding difference. For most purposes the displayed figure is exact enough, but if you need more precision, work from the unrounded inputs rather than from the rounded outputs.

The line coefficients, explained

The coefficients A, B and C define the line, and the ratio between them is what matters, not their absolute size. The line 3x plus 4y minus 10 equals zero is the same line as 6x plus 8y minus 20 equals zero, because the second equation is the first multiplied by 2. The distance formula gives the same answer for both, because the numerator doubles and the denominator doubles too, and the ratio stays the same.

The pair (A, B) is the normal vector of the line, which points perpendicular to it. Its length, the square root of A squared plus B squared, is the denominator of the formula. When the line is written with A squared plus B squared equal to 1, the line is in normal form, and the distance is simply the absolute value of the numerator, which is why textbooks often normalise the line first.

The sign of the numerator, before the absolute value, tells which side of the line the point is on. Two points with numerators of opposite signs lie on opposite sides of the line, while two points with the same sign lie on the same side. The calculator shows the absolute value, so it gives the distance without the side, but the sign is useful in geometry problems about which side a point lies on.

A worked example: point (1, 2) to the line 3x + 4y - 10 = 0

Take the line 3x plus 4y minus 10 equals zero, and the point (1, 2). The line is a familiar one, and the point is close to it, so the distance should be small.

The numerator is the absolute value of 3 times 1 plus 4 times 2 minus 10, which is the absolute value of 1, giving 1.00. The denominator is the square root of 9 plus 16, which is the square root of 25, giving 5.00. Divide the numerator by the denominator, and the distance is 0.20 units.

A distance of 0.20 units means the point sits very close to the line, just a fifth of a unit away, measured perpendicularly. The perpendicular from the point meets the line at a point slightly away from (1, 2), and the short segment between them is the distance. If the point had been (1, 2) on a line through (1, 2), the numerator would have been zero and the distance would have been zero.

Who uses the point-to-line distance

Students in Class 11 use it as a standard coordinate geometry formula, and it appears in problems about the distance from a point to a line, the distance between parallel lines, and the area of a triangle given its vertices and a base. It is one of the few formulas that gives a geometric distance directly from an equation.

Computer graphics uses it for collision detection, for picking objects with a mouse, and for measuring how far a point is from an edge. When a user clicks near a line on the screen, the program measures the distance from the click to the line to decide whether the line was selected.

Engineers and CAD users use it for clearances: the distance from a point, such as a hole or a bolt, to a line, such as an edge or a wall. The perpendicular distance is the clearance, and it must be larger than a minimum, or the design fails. A Pythagorean theorem calculator is the tool for the right-angled triangle that the perpendicular creates.

The calculator is only as good as the numbers you type into it. A rate from last month, a measurement taken roughly, or a unit entered wrongly will all give a confident-looking answer that is simply wrong. The best habit is to enter the numbers twice, from two sources, and to check that the answer makes sense before you act on it. A result that surprises you is usually a sign to recheck the inputs, not to trust the surprise. For a related calculation, the triangle area calculator covers the next number most people need after this one.

Point-to-line distance vs point-to-point distance

Point-to-point distance is the length of the straight segment joining two points, and it is found with the Pythagorean theorem. Point-to-line distance is the shortest distance from a point to any point on a line, and it is always measured perpendicularly. The two are different measurements, and confusing them gives a wrong answer, because the distance to a specific point on the line is always longer than the perpendicular distance, unless that point happens to be the foot of the perpendicular.

In practice, the point-to-line distance is the one to use when the target is a line, such as a road, a wall or an edge, and the point-to-point distance is the one to use when the target is a specific place. The perpendicular is the shortest route to a line, so it is the distance that matters for clearance, for closest approach, and for any question about how near a point is to a line.

Neither tool replaces the other. Pick the one that answers the exact question you have, and if the question changes halfway through, switch tools rather than forcing the first one to fit. The two tools are designed to be used together, each answering the part of the question it was built for.

Common mistakes with point-to-line distance

The first is forgetting the absolute value, which gives a negative distance when the point is on the negative side of the line. The second is forgetting the denominator, which gives the numerator alone, a number that changes when the line equation is scaled.

The third is using the wrong form of the line, such as y equals mx plus c, without converting it to Ax plus By plus C equals zero first. The fourth is measuring to a specific point on the line instead of to the perpendicular foot, which gives a longer distance than the true one.

Check your answer by finding the foot of the perpendicular and measuring the distance to it with the point-to-point formula. The two answers must agree. If they do not, the coefficients or the point are entered wrongly.

How to use this point to line distance calculator

To use it, enter a; enter b; enter c; enter point x0, then read the results box at the top. The main result is highlighted, and the other rows give the supporting figures. If an answer looks wrong, check the inputs first: a misplaced decimal or a wrong unit is the usual cause, not the formula.

Write your line in the form Ax plus By plus C equals zero, enter A, B and C, then enter the point coordinates. Read the distance first, then the numerator and denominator to check the steps. If the distance is zero, the point lies on the line, which is a useful check in itself.

No data leaves your device: the maths runs entirely in your browser, with no sign-up and no server round-trip. You can change a number, see the answer move, and change it back, all instantly. It is a private way to check a figure before you talk to a professional about it. The page has no tracking of the numbers you enter, and closing the tab leaves nothing behind.

Frequently Asked Questions

For a line Ax plus By plus C equals zero and a point (x0, y0), the distance is the absolute value of (A times x0 plus B times y0 plus C) divided by the square root of (A squared plus B squared). It is the length of the perpendicular from the point to the line.

Because the perpendicular is the shortest path from a point to a line. Any other segment from the point to the line is longer, so the perpendicular distance is the true distance, in the same way that the shortest distance from a point to a road is straight across, not diagonally.

It means the point lies on the line. The numerator, A times x0 plus B times y0 plus C, is zero exactly when the point satisfies the line equation, so a zero distance is a test for whether a point is on a line.

Pick any point on one line, and find its distance to the other line with this calculator. Because the lines are parallel, the distance is the same from every point, so any point will do. The formula is the same, with the point taken from the first line.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.