Home·Geometry

Point to Line Distance

The shortest path meets the line at a right angle. Put the point into the slope-intercept form and divide by √(m²+1), which corrects for how steeply the line leans.

Your numbers

Distance

2.2361

x

4

y

9

Formula

Distance = |Slope × x₁ − y₁ + y-intercept| ÷ √(Slope² + 1)

The extra coordinates are the foot of the perpendicular — the closest point on the line itself.

What to enter

InputDefaultAccepted range
x₁The horizontal coordinate of the first point.6No limit
y₁The vertical coordinate of the first point.8No limit
SlopeHow much y rises per 1 of x — the m in y = mx + b.2No limit
y-interceptWhere the line crosses the y axis — the b in y = mx + b.1No limit

Step by step

FormulaDistance = |Slope × x₁ − y₁ + y-intercept| ÷ √(Slope² + 1)
With the default numbersDistance = |2 × 6 − 8 + 1| ÷ √(2² + 1)
AnswerDistance = 2.2361

Quick reference table

Results when only x₁ changes and everything else stays put.

x₁Distancexy
30.44723.47.8
4.50.89443.78.4
62.236149
94.91934.610.2
127.60265.211.4

What each result means

ResultAt default values
DistanceThe straight-line distance between two points.2.2361
xThe horizontal position in Cartesian form.4
yThe vertical position in Cartesian form.9

Common mistakes

The extra coordinates are the foot of the perpendicular — the closest point on the line itself.

Glossary

x₁
The horizontal coordinate of the first point.
y₁
The vertical coordinate of the first point.
Slope
How much y rises per 1 of x — the m in y = mx + b.
y-intercept
Where the line crosses the y axis — the b in y = mx + b.
Distance
The straight-line distance between two points.
x
The horizontal position in Cartesian form.
y
The vertical position in Cartesian form.

Frequently asked questions

Q. How is Point to Line Distance calculated?

Distance = |Slope × x₁ − y₁ + y-intercept| ÷ √(Slope² + 1) — The shortest path meets the line at a right angle. Put the point into the slope-intercept form and divide by √(m²+1), which corrects for how steeply the line leans.

Q. Can you walk through an example?

With x₁ 6, y₁ 8, Slope 2, y-intercept 1, the answer is Distance 2.2361.

Q. What do I need to enter?

Enter x₁, y₁, Slope, y-intercept. The result recalculates as you type, and an empty box counts as zero.

Q. How much does the answer move if I change a number?

Changing only x₁ moves the answer to x₁ 3 → Distance 0.4472 and x₁ 12 → Distance 7.6026. The table below lays out five steps.

Q. How are the numbers rounded?

Money is shown to the nearest whole unit, percentages to one decimal place and everything else to two. What you see is rounded; the calculation itself carries the unrounded value forward.

Q. Anything to watch out for?

The extra coordinates are the foot of the perpendicular — the closest point on the line itself.

Related calculators

Keep your length units consistent across inputs — mixing centimetres and metres throws results far off.