SVG path parser & preview
Parse an SVG d attribute: every segment is listed with its command, arguments, end point, length and bounding box, covering M/L/H/V/C/S/Q/T/A/Z and relative coordinates, with sampled curve lengths and a live path preview.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
SVG path d attribute
Paste the d attribute (without the <path> tag). All of M/L/H/V/C/S/Q/T/A/Z are supported, and lowercase letters mean relative coordinates.
Parse result
Curve lengths and the bounding box are sampling approximations, not closed-form solutions — more samples means more precision.
Paste a d attribute and it is parsed immediately.
What this tool does
- A giant d attribute exported from a design tool is unreadable — paste it and get every command, endpoint and length listed so you know what it actually draws.
- Path animations need the total length for stroke-dasharray; the reported total length is exactly that number.
- Need a bounding box for "text on a path" or auto-padding an icon? The reported x/y range drops straight into a viewBox.
- Hand-writing paths and getting relative coordinates wrong? The endpoint list makes a missing dimension in h/v obvious.
Example
Input
M 10 10 L 40 10 H 40 V 40 Z
Output
Segments: 5 Sub-paths: 1 Has curves: No Total length: 102.426 Bounding box: x 10.00 → 40.00, y 10.00 → 40.00
Every segment except M and the closing command is listed with its arguments, endpoint and length: L and V are 30 each, Z travels 42.43 back to the start, and M contributes no length.
Frequently asked questions
Are the curve lengths exact?
No, they are sampling approximations. Exact cubic/quadratic/arc lengths require solving the derivative roots or Gauss–Legendre quadrature; sampling at 32 points is typically within 0.1% and the slider goes up to 256 points.
How are relative (lowercase) commands handled?
Fully. Each coordinate of a lowercase command accumulates onto the current point, all reported endpoints are absolute, and every segment states whether it was written as a relative command.
Why does the M command have no length?
A moveto only moves the pen, it does not draw. Its length is 0 and the previous point is excluded from the bounding box — otherwise multi-sub-path shapes would report a wildly inflated box.
Are the implicit S / T control points correct?
Yes. S reflects the previous cubic control point through the current point and T does the same for the previous quadratic control point; when the preceding command is not of the same kind the control point collapses onto the current point.
Why does the preview differ from my rendering?
The preview rebuilds the parsed commands into a fresh SVG and always strokes it with fill forced to none. If your original relies on fill, clip-path or transforms the shapes will differ — this tool parses the d attribute only.
Keywords:svg path