SVG Stroke to Fill Converter
Convert SVG stroked paths to filled outlines — required for icon fonts, Cricut/laser cutting, and boolean path operations.
Last updated: March 25, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is SVG Stroke to Fill Converter?
In SVG, shapes can be rendered two ways: using a stroke (a line drawn along the center of a path with a configurable width) or a fill (the interior area of a closed path). While strokes look identical to filled outlines at normal sizes, they behave fundamentally differently in certain technical contexts. A stroke is described as a center-line path plus a stroke-width attribute, and when the SVG is scaled, the stroke-width scales with it (or doesn't, depending on vector-effect settings). A filled outline is a closed path where every edge pixel is part of the fill area.
Converting a stroke to a fill (also called "expanding" or "outlining" strokes) replaces the stroked path with a new closed path tracing the outer and inner edges of where the stroke would render. Required contexts: SVG fonts and icon fonts expect filled paths (no stroke support). Cricut, Silhouette, and laser cutter software like LightBurn require closed filled outlines for precise cut paths. Boolean path operations (unite, subtract, intersect) in Figma, Illustrator, and Inkscape require all inputs to be filled paths. The most reliable desktop tool for this is Inkscape (Object → Stroke to Path) or Illustrator (Object → Path → Outline Stroke). This browser tool performs the same operation on SVG code without requiring a desktop application.
How to Use SVG Stroke to Fill Converter
Paste your SVG code into the input area, or upload an .svg file
Click "Expand Strokes" to process the SVG — all path, line, polyline, and rect strokes are converted to filled outline paths
Preview the result in the preview pane — the visual appearance should look identical to the original
If the result has unwanted inner fills (especially for round stroke ends), toggle "Remove Inner Paths" for a cleaner result
Click "Copy SVG" to copy the outline-expanded SVG code, or "Download SVG" to save the file
Common Use Cases
- Converting stroke-based icons from an icon library to filled paths before creating an icon font (TTF/WOFF)
- Preparing SVG designs with strokes for a Cricut cutting machine that requires closed filled paths
- Converting SVG elements before boolean operations in Figma (Union, Subtract, Intersect only work on fills)
- Fixing SVG files exported from Illustrator with strokes before importing into laser cutting software (LightBurn)
- Converting outlined text (already converted to paths with stroke) to filled characters for a custom typeface
- Cleaning up SVGs from a drawing app that exports paths with stroke-width for use in a CSS clip-path
- Preparing icon SVGs for use in a web component library where stroke-width scaling artifacts appear at various sizes
- Converting a hand-drawn SVG sketch (with stroke paths) to solid filled shapes for print production
Example Input and Output
Converting a simple stroked line to a filled rectangle path:
<!-- Stroked path: visual 4px-wide diagonal line -->
<svg width="100" height="100" viewBox="0 0 100 100">
<path d="M 10 10 L 90 90"
stroke="#333"
stroke-width="4"
stroke-linecap="round"
fill="none"/>
</svg><!-- After expansion: same visual, now a filled shape -->
<svg width="100" height="100" viewBox="0 0 100 100">
<!-- The single <path> is now a filled outline shape -->
<path d="M 12.83 7.17 C 14.25 5.75, 15.75 5.75,
17.17 7.17 L 92.83 82.83 C 94.25 84.25,
94.25 85.75, 92.83 87.17 C 91.41 88.59,
89.91 88.59, 88.49 87.17 L 12.83 12.83
C 10.75 10.75, 11.41 8.59, 12.83 7.17 Z"
fill="#333"
stroke="none"/>
</svg>Client-Side Processing
SVG stroke expansion is computed entirely in your browser using JavaScript geometry calculations. Your SVG code — potentially containing proprietary icon designs or illustrations — is never sent to any server.
Clean Up with SVGO After Conversion
Stroke-to-fill conversion generates new path coordinate data that may include floating-point precision noise. After converting, run the output SVG through the SVG Optimizer (SVGO) tool available on this site to reduce coordinate precision (rounding to 1-2 decimal places), remove redundant attributes, and collapse compatible paths — typically reducing file size by 20-40%.
Inkscape as Desktop Alternative
For complex SVG files with many paths, gradients, filters, or text elements, Inkscape (free, open-source) provides the most reliable stroke-to-path conversion. Select all (Ctrl+A), then Object → Stroke to Path (Shift+Ctrl+C). Inkscape handles edge cases like dashed strokes, markers, and gradient paints more accurately than browser-based tools. The Inkscape CLI also supports batch conversion: inkscape input.svg --actions="select-all;object-stroke-to-path" --export-filename=output.svg.
Frequently Asked Questions
Why do icon font generators require filled paths?
What is the difference between "Stroke to Path" and "Outline Stroke" in Inkscape?
Does stroke-to-fill affect how the SVG looks visually?
Why does Cricut/Silhouette require filled paths?
Can I convert a stroke with a gradient?
What happens when there are both stroke and fill on the same element?
How This Tool Works
The SVG code is parsed into a DOM using DOMParser. All path, line, polyline, circle, rect, and ellipse elements with stroke attributes are identified. For each stroked element: the stroke geometry is computed by expanding the center-line path by stroke-width/2 on each side, applying linecap and linejoin calculations to end caps and corner joins. The resulting outer and inner contours form a closed fill-only path element. The original stroke attributes are removed and the new filled path element is inserted into the SVG DOM. The modified SVG is serialized back to a string for display.
Technical Stack