Line Segment Length Calculator

    Calculate the length of a line segment from endpoint coordinates in 2D or 3D, with midpoint, coordinate differences, direction vector, and a 2D preview.

    Point A - start point
    Point B - end point

    Line segment length from endpoints

    English search intent for a line segment length calculator is the straight-line distance between two endpoints. Enter point A and point B, then use the distance formula to get the length of segment AB.

    AB is the 2D segment length between endpoints A(x1, y1) and B(x2, y2).

    Add the z-coordinate difference when both endpoints are in 3D.

    What the calculator returns

    • Segment length between endpoint A and endpoint B.
    • Coordinate differences and the direction vector from A to B.
    • The midpoint of the segment.
    • Direction cosines or unit direction when the segment length is not zero.
    • A 2D preview for plane-coordinate inputs.
    This is Cartesian coordinate geometry. It is not a route-distance or latitude/longitude distance calculator.

    Examples

    Point APoint BLength
    (0, 0)(3, 4)5
    (-2, 1)(2, 4)5
    (0, 0, 0)(1, 2, 2)3
    (2, 1, -1)(5, 5, 3)about 6.403

    Frequently Asked Questions

    Sources and References

    Calculations are based on the listed reference sources. Links open in a new tab.

    Updated:

    Related Tools