An SVG path generator makes the d attribute readable. That one string draws every icon, chart line and custom shape that is not a simple rectangle or circle, but it is written as terse single-letter commands and bare numbers, so you cannot tell what it draws until it renders.
This tool turns it into labelled rows. You edit commands, the preview redraws, and the finished path string and a complete SVG snippet are ready to copy. It is useful when no icon set has the shape you need, or when you must understand a path someone else wrote before changing it.
What This SVG Path Generator Does
Each row holds one command (move, line, horizontal, vertical, cubic, quadratic, arc or close) and its parameters. Use the buttons to append a line, cubic, quadratic, arc or close; to add a move (a new subpath) or a horizontal or vertical line, change a row's command in its dropdown. The preview redraws on every edit, and the output box gives the path plus self-contained SVG markup with your stroke width and fill.
The result panel reads its numbers from the browser's rendering of the path: total path length, the command count, the number of subpaths (counted as the number of M commands), the bounding box of the geometry (stroke width excluded) and whether a close command is present.
How to Use It
- Start with a move. A path begins with
Mand a starting point, because everything else continues from the current point. - Add commands in drawing order. Each continues from where the previous one ended.
- Type parameters as space-separated numbers. The grey hint under each row lists what that command expects.
- Close the shape with
Zif you want it filled or want a clean join at the start point. - Set the precision and copy. One or two decimals is enough for most icons.
How the Commands Work
Path commands are defined in the W3C SVG 2 paths specification. M x y moves without drawing. L x y draws a straight line. H x and V y draw horizontal and vertical lines with a single coordinate. Z closes the subpath with a line back to its start.
C x1 y1 x2 y2 x y draws a cubic Bézier with two control points, which sets the departure and arrival directions independently. Q x1 y1 x y draws a quadratic Bézier with one control point: shorter, less flexible. The smooth variants S and T exist in SVG but are not offered in this tool's dropdown.
A rx ry rotation large-arc-flag sweep-flag x y draws an elliptical arc. Two of its seven parameters are flags (0 or 1). Between two points there are four possible arcs for a given radius, and the two flags choose which one. Flipping a flag changes the shape completely, so arcs are usually tuned by trying values.
Uppercase and Lowercase Are Different Commands
Uppercase commands use absolute coordinates, measured from the origin. Lowercase commands use relative coordinates, measured from the current point. L 100 50 goes to the point (100, 50). l 100 50 goes 100 right and 50 down from wherever the pen is.
Absolute coordinates are easier to edit one command at a time. Relative ones give shorter strings and let you move a whole shape by changing only the first M. Many design tools export relative commands, which is why exported paths look like a wall of numbers. This tool's dropdown lists each command in both cases for reference, but its output uses whatever letter you pick, so mixing cases changes the meaning of everything after it.
Fill Rules and Holes
A path can contain several subpaths: every M after the first starts a new one. That is how a letter O or a donut is one element. Which areas fill is decided by the fill rule. The default, nonzero, only makes a hole if the inner subpath runs in the opposite direction to the outer one. The evenodd rule, described in the SVG 2 painting specification, fills where the number of boundary crossings is odd, so the hole appears whichever way the inner path runs. This tool's fill control only picks a colour and does not set a fill rule, so add fill-rule="evenodd" to the copied markup yourself if you need it.
Path Length and Line-Drawing Animation
A self-drawing line works by setting stroke-dasharray to the path length and animating stroke-dashoffset from that length to zero. That is why path length is the headline number here. The browser's getTotalLength() returns it. Because the length of a Bézier curve has no simple formula, treat it as a very close approximation, and round up slightly: an offset a little larger than the path keeps the line fully hidden at the start, while a smaller one leaves a visible stub.
Precision and File Size
Exported paths often carry six or more decimals per coordinate, which is far finer than anyone can see on a small icon. The precision field rounds every number in the output, up to four decimals. Lowering it shrinks the string. Watch the preview as you reduce it: at zero decimals, curves on a small canvas begin to flatten, which shows the limit for your shape. Keep enough precision that the shape looks unchanged at its largest displayed size. Note the rounding is applied to the text of each row, so very small coordinates such as 0.004 become 0 at two decimals.
When a Path Is the Wrong Tool
SVG has dedicated elements for rectangles, circles, ellipses, lines and polygons. They are shorter, easier to maintain, and let you animate attributes such as a circle's radius directly. Use a path for curves those elements cannot express, or when several subpaths need one fill. Drawing a rectangle as a path is a habit from design-tool exports, not a requirement.
Arb Digital's web team builds sites with inline SVG, simple icon systems and sensible asset budgets for mobile connections.
Web Design Services Talk to Arb DigitalHow to Read the Result
- Path length is the figure to use for dash animations. It includes the closing line when a
Zis present. - Bounding box is width by height of the geometry in user units. If it is far smaller than 300 by 200, your shape will look small in the default viewBox. If it is larger, part of the path will be clipped.
- Subpaths greater than 1 means the shape has separate pieces or holes, so the fill rule matters.
- Closed: No means no
Zrow exists. A fill will still close the area visually, but the stroke leaves an open gap with end caps. - A dash (—) in the bounding box usually means the path has no extent yet or the parameters could not be parsed.
What to Do Next
- Copy the markup into your page. It uses a 300 by 200 viewBox, so change the viewBox to the real size of your artwork.
- Replace the stroke colour. The copied markup uses navy (#1B3A6B), the tool's preview colour.
- For a drawing animation, paste the path length into
stroke-dasharrayand animate the offset with the CSS animation generator. - Rasterise a finished graphic with SVG to PNG, or use the favicon generator for site icons.
Common Mistakes
- Starting without a move command. Nothing renders without an initial
M. - Mixing absolute and relative commands by accident.
- Expecting a hole from a same-direction inner subpath under the default fill rule.
- Shipping excess decimals on every icon.
- Using a path for a rectangle or circle.
More tools are in the free tools hub, including the CSS minifier for the stylesheet that ships alongside your SVG.
Worked Example With the Default Path
The page loads with this path on a 300 by 200 canvas, stroke width 4, no fill, precision 2:
M 20 150 C 60 40 120 40 160 120 Q 200 190 280 90 L 280 170 Z
Run in a browser, it produces:
- Path length: 706.3 units
- Commands: 5
- Subpaths: 1
- Bounding box: 260 × 107
- Closed: Yes
The bounding box width is 280 minus 20 = 260, matching the leftmost and rightmost points. The final Z adds a straight line from (280, 170) back to (20, 150), which is about 260.8 units of the 706.3. Use 707 as the dash length so the line starts fully hidden. These figures come from the browser and can differ very slightly between browsers.
Frequently Asked Questions
It holds the entire drawing instruction for a path as a sequence of single-letter commands followed by numeric parameters, such as move, line, curve, arc, and close.
Uppercase commands use absolute coordinates measured from the origin. Lowercase commands use relative coordinates measured from the current point, which makes a shape easy to move by editing only the first command.
A cubic curve has two control points and can set the departure and arrival tangents independently, so it handles S-shapes. A quadratic has one control point and is shorter but less flexible.
The large-arc flag chooses between the longer and shorter of the two possible arcs, and the sweep flag chooses the direction of travel. Together they select one of four candidate arcs.
With the default nonzero fill rule, an inner subpath must be drawn in the opposite direction to the outer one to create a hole. Adding fill-rule="evenodd" to the copied markup removes that dependency.
Set stroke-dasharray to the total path length and animate stroke-dashoffset from that length to zero. This tool reports the length you need.
One or two is enough for most icons. Check the preview at your largest display size, because more precision than that is usually invisible and adds to file size.