Skip to content
SVG Optimizer

SVG Optimizer

v1.0

Strip comments, metadata, and redundant precision from SVG markup and watch the byte count drop, with a before and after preview so you can check that the drawing still looks the same.

Runs locally — nothing leaves your browser.

Input SVG
Click to upload, drag and drop, or paste
.svg, image/svg+xml · Max 2.0 MB
Optimized SVG
One element per line, easier to read but a few bytes bigger.
Before578B
After—
Saved—
Original
Nothing to preview
Optimized
Nothing to preview
Plugins
SafeCleanup and minification that never changes how the SVG renders.
Strip <!-- … --> comments.
Drop <metadata> blocks (editor/author data).
Remove non-essential <desc> descriptions.
Strip <script> elements and on* handlers from the output.
Shorten IDs and drop unused ones.
Drop attributes with empty values.
Remove container elements with no children.
Collapse redundant <g> wrappers.
Merge adjacent sibling paths into one.
Round and shorten path coordinates.
Rewrite colors to their shortest form (#ffffff → #fff).
Minify the CSS inside <style> elements.
Convert inline style properties to presentation attributes.
Remove stroke/fill declarations that have no effect.
Order attributes consistently for better gzip.
RiskyThese change the file's structure. Read the warning before you turn one on.
Delete the viewBox attribute.Can break responsive scaling — leave off for inline/CSS-sized SVGs.
Delete width/height so the SVG scales to its container.Only safe when a viewBox is present to define the aspect ratio.
Convert <rect>/<circle>/… into <path>.Smaller, but harder to hand-edit and no longer semantic shapes.
Delete <title> elements.Hurts accessibility — <title> is the SVG's accessible name.
Strip the root xmlns attribute.Only valid for SVG inlined directly in HTML, not standalone files.

Need to fine-tune a path? Try SVG Path Editor →

Starting from a PNG or JPEG? Try Image Tracer →