Get to know MDN better
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The getPathSegmentAtLength() method of the SVGPathElement interface returns the path segment at a given distance along the path.
A number indicating the distance along the path.
A path segment object. If no valid segment exists, returns null.
Segment object has the following properties:
type valuesAn array or value containing the parameters for the corresponding command.
Consider the following <path> element, drawing a square:
The getPathSegmentAtLength() method will return an object that represents the v64 segment that lays 65px along the path:
| SVG Paths # __svg__SVGPathElement__getPathSegmentAtLength |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jun 23, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.