Skip to content
D DocNectar

Free Point-to-Line Distance Calculator

Calculate the shortest (perpendicular) distance from a point to a line defined by two points.

100% Free No Signup Works on all devices

Built and fact-checked by the DocNectar team — see our editorial standards

Thanks for rating!

Key Features

Instant Calculation

Get accurate results in real time with our optimized algorithm.

Mobile Friendly

Fully responsive design. Works on all devices & screen sizes.

Privacy Focused

Your data stays on your device. We don't store any inputs.

100% Free

No hidden costs. This tool is completely free forever.

The shortest distance from a point to a line is always measured perpendicular to the line — not straight to either of its defining points — and finding it requires a specific formula rather than basic distance calculations.

This calculator finds that perpendicular distance from any point to a line defined by two other points, with a full step-by-step solution.

How it works

Enter the coordinates of two points that define the line, plus the coordinates of the point you want to measure from. The calculator applies the standard point-to-line distance formula, which uses the line's direction to find the shortest (perpendicular) distance to the given point.

  1. Enter line point 1 — x.
  2. Enter line point 1 — y.
  3. Enter line point 2 — x.
  4. Enter line point 2 — y.
  5. Enter point — x.
  6. Enter point — y.
  7. Click Calculate to see your results.

Examples

Distance from (2, 3) to the x-axis

The line through (0, 0) and (4, 0) is the x-axis. The perpendicular distance from the point (2, 3) to this line is exactly 3 — the point's y-coordinate, since the line is horizontal.

Who should use it

  • Finding how far a point deviates from a reference line in geometry or physics problems.
  • Computing perpendicular offsets in CAD, mapping, or computer graphics applications.

Industry applications

  • Geometry and physics education
  • CAD, mapping, and computer graphics

Advantages

  • Finds the true shortest (perpendicular) distance, not just the distance to one endpoint.
  • Includes a complete, formula-based step-by-step solution.

Limitations

  • Limited to 2D coordinates — 3D point-to-line distance requires a different formula.

Common mistakes to avoid

  • Calculating the distance to one of the line's defining points instead of the true perpendicular distance to the line itself.
  • Entering the same point twice for the line, which doesn't define a valid direction.

Best practices

  • Double-check that the two points you enter for the line are genuinely distinct and correctly represent the line you intend to measure against.

Tips

  • If you already have the line in slope-intercept or standard form rather than two points, pick any two distinct points that satisfy the line's equation to use with this calculator.

Frequently asked questions

Yes, with no signup and no limit on how many calculations you run.
The distance to a single point on the line is almost always longer than the true shortest distance, which is measured perpendicular to the line — the point-to-line distance formula accounts for the line's full direction, not just one point on it.
Two identical points don't define a unique line, so the calculator requires two distinct points to determine the line's direction.
No, this calculator is for 2D coordinates only — the point-to-line distance formula in 3D uses a different (cross-product-based) approach.

Get new calculators and guides in your inbox

No spam — just new tools like Point-to-Line Distance Calculator and practical guides.

Favorites