Paste your SVG on the left, click Optimize, then copy the result from the right.
Use this when an SVG export from a design tool still carries comments, blank lines between tags, or editor-only Inkscape and Sodipodi attributes that do not change how the graphic draws.
Optimize keeps the vector shapes intact while reporting how many bytes you saved. Copy the result into HTML, a CMS field, or a source file. If you need a PNG bitmap instead, use the related SVG to PNG tool after you clean the markup.
SVG Optimizer & Minifier
Paste SVG markup and get a smaller copy by stripping comments and wasted whitespace.
Paste your SVG on the left, click Optimize, then copy the result from the right.
Key features
- A source pane on the left for pasting SVG markup.
- An optimized result on the right with a Copy Output button.
- Input and output byte sizes with the percent you saved.
- A live preview of the optimized graphic.
- Editor-only metadata (Inkscape / Sodipodi attributes, metadata blocks) is removed, while title and desc stay for accessibility.
When to use it
Typical use: cleaning a design-tool export before you inline it in HTML, or checking how much size a light minify saves.
What happens with a fragment or a syntax error
Svg Optimizer & Minifier checks the pasted markup before it removes anything. Paste a snippet that is missing its outer <svg> wrapper - just a <path> or <g> block copied from inside a bigger file - and Optimize rejects it with Root element must be <svg>. rather than guessing at a wrapper for you. Wrap the snippet in <svg xmlns="http://www.w3.org/2000/svg">...</svg> and paste the whole thing instead.
If the markup itself is broken - an unclosed tag or a stray angle bracket - the parser stops and Optimize shows Could not parse SVG. Check for unclosed tags or invalid markup. Clicking Optimize with the box empty shows Paste SVG markup first. rather than running on nothing. In every one of these three cases the tool tells you exactly what to fix instead of returning a partial or corrupted result.
What optimizing does not clean up
Optimize removes the <metadata> block and the <sodipodi:namedview> canvas-settings element that design tools such as Inkscape write into an export, and it strips any inkscape: or sodipodi: attribute from the elements that remain. What it does not remove is the xmlns:inkscape or xmlns:sodipodi namespace declaration on the root <svg> tag itself - once that declaration is written, the optimized output keeps it even after every attribute and element that used it is gone. A leading <?xml version="1.0"...?> declaration is dropped when the source has one, since markup inlined into HTML does not need it. For path simplification, shape merging, or a full plugin pipeline, a dedicated SVGO-based tool is the right choice - this optimizer only removes what never changes how the graphic renders.
Privacy
Everything runs in the browser - no upload and no account. Closing the tab discards your markup.
For step-by-step clicks see the step-by-step guide; for when this fits versus desktop tools see when to use and vs alternatives.
Frequently Asked Questions
What does SVG Optimizer & Minifier do?
Paste SVG markup and get a smaller copy by stripping comments and wasted whitespace.
How do I use it?
Paste your SVG on the left, click Optimize, then copy the result from the right.
What gets removed?
Editor-only metadata (Inkscape / Sodipodi attributes, metadata blocks) is removed; title and desc stay for accessibility.
What happens if I paste an SVG fragment without the outer svg tag?
It is rejected with the message "Root element must be <svg>." Svg Optimizer & Minifier requires the pasted markup's root element to literally be <svg>, so wrap a bare <path> or <g> snippet in <svg>...</svg> before pasting it.
What happens if my SVG markup has a syntax error?
You will see "Could not parse SVG. Check for unclosed tags or invalid markup." - the same message covers an unclosed tag, a mismatched bracket, or any other XML parsing failure, and nothing is optimized until the markup parses cleanly.
Does it remove unused xmlns:inkscape or xmlns:sodipodi namespace declarations?
No. It removes the inkscape: and sodipodi: attributes plus the metadata and sodipodi:namedview elements, but the xmlns:inkscape or xmlns:sodipodi namespace declaration on the root svg tag stays even after nothing inside the file uses it anymore.
What happens if Copy Output cannot reach the clipboard?
Nothing visible - if the browser blocks the clipboard write (a denied permission or an insecure context), Copy Output fails silently with no error message. Select the text in the output box and copy it manually as a fallback. Clicking Copy Output on an empty output box also does nothing.