Minify SVG Vectors and Strip Editor Metadata
Upload an SVG, strip comments, metadata and editor namespaces, and minify it to cut file size.
- No upload
- No signup
- Free
Loading tool…
Your file stays in this browser. Nothing is uploaded.
Loading tool…
Your file stays in this browser. Nothing is uploaded.
How Vector SVG Optimizer works
Browser Toolset Vector SVG Optimizer minifies an uploaded SVG file directly in your browser memory. It strips comments, metadata blocks, Inkscape and similar editor namespaces, and empty <defs>, then collapses whitespace, with zero server uploads. It does not rewrite path data or sanitize scripts.
How to use this tool
- Click "Upload SVG" and choose an .svg file (the page starts with a sample so you can try it first).
- Toggle the options: Strip Comments, Strip Metadata, Clean Namespaces, and Minify Code (collapse whitespace).
- Check the Live Vector Render of the optimized SVG and read the output in the Clean SVG Code box.
- Compare the Original and Optimized sizes and the percentage saved, which update as you change the options.
- Click "Copy" to copy the minified SVG code or "Download" to save it as an .svg file.
Common uses
- Cleaning SVG icons exported from Figma, Sketch, or Adobe Illustrator for production web apps.
- Reducing web page bundle size by trimming SVG files.
- Stripping comments and metadata from SVGs before sharing or committing them.
- Preparing vector graphics for seamless embedding in React and Vue component libraries.
Frequently asked questions
How much file size reduction can I expect on SVGs from Figma or Illustrator?
It depends on the file. The tool shows the original size, the optimized size and the percentage saved, so you can see the result for your own SVG. Files with many comments, metadata blocks and editor attributes shrink the most, while files that are mostly path data shrink little.
Does the optimizer remove scripts from an SVG?
No. It is a text minifier, not a sanitizer. It does not strip script tags or event attributes, so do not treat its output as safe for untrusted SVG files, and review any SVG from an unknown source before using it.
Does optimizing SVG damage vector paths or shapes?
It does not touch path data or shapes. The tool only removes the XML declaration and DOCTYPE, comments, metadata, editor namespaces and empty defs, and collapses whitespace. Compare the Live Vector Render with your original and untick an option if something looks wrong.
Can I copy the output as an inline SVG string for React components?
Yes. After you load an SVG, Copy puts the optimized markup on your clipboard so you can paste it into a JSX or TSX component, an HTML file or CSS. Attributes such as class may need renaming to className in JSX.
Are my proprietary logo graphics uploaded to any server?
No. The SVG is read and optimized in your browser and is not uploaded, so unreleased logos stay on your device. The Download button saves the optimized copy as an .svg file straight from the page.
Details and limits
Scalable Vector Graphics (SVG) are the gold standard for web iconography, brand logos, and illustrations due to their infinite scalability and minimal file footprint. However, vector authoring software like Adobe Illustrator, Figma, and Inkscape routinely export massive amounts of bloat: editor metadata, comments, namespaces, and redundant whitespace.
Browser Toolset Vector SVG Optimizer cleans and compresses raw SVG code directly in local browser memory. By purging comments, metadata blocks, editor namespaces and empty <defs> elements and collapsing whitespace, our optimizer reduces file size. It does not round path coordinates or rewrite shapes, and it does not sanitize scripts, so review SVGs from untrusted sources separately.
Copy the minified inline vector string or download the optimized file; the SVG is not uploaded.
What the optimizer does to your SVG
The SVG is read as text inside your browser and cleaned with a short list of text replacements. There is no upload and no server step. The page opens with a small sample. To work on your own graphic, use the Upload SVG button, because the code box on the page is a read-only result field and cannot be pasted into. Results update the moment you tick or untick an option, and the preview next to it is drawn from the cleaned markup.
Two clean-ups always run: the XML declaration and any DOCTYPE line are removed. Four checkboxes control the rest, and all four start ticked.
Features and limits
- Strip Comments removes every comment in the file.
- Strip Metadata removes metadata blocks and defs sections that are completely empty. A defs section that contains gradients, filters or clip paths is left alone, whether or not anything uses it.
- Clean Namespaces removes the xmlns declarations for inkscape, sodipodi, sketch and illustrator, together with the elements and attributes that use those prefixes, such as sodipodi:namedview, so no undeclared prefix is left behind. A declaration is kept if something with its prefix is still in the file.
- Minify Code collapses every run of whitespace into one space and removes whitespace between tags. Whitespace inside text and pre elements is left exactly as written, so deliberate spaces and line breaks in text are kept.
- Not done: path data is not rewritten or rounded, ids are not shortened, shapes are not merged, and the content is not sanitised. Script elements, event attributes and external references are copied through untouched.
- The size panel shows original and optimized size, and the percentage saved appears only when the file got smaller. Copy puts the code on the clipboard and Download saves optimized_ followed by a timestamp as an .svg file.
- Upload reads one file as text, and the code applies no size limit of its own.
Checking the result before you use it
Treat the output as a lightly cleaned copy rather than a fully optimized one. Gains are largest on editor exports full of comments, metadata and indentation, and small on compact hand-written icons. Compare the preview with the original before you replace the source file.
Because nothing is sanitised, do not assume a downloaded file is safe to embed. If an SVG came from someone else, remove script elements and onload-style attributes yourself first. An SVG shown through an img tag does not run scripts, but markup pasted inline into a page can. To turn the cleaned code into a data URI, use Base64 Studio (Text & Files). For bitmap formats, the Image Format Converter and Smart Image Compressor handle PNG and JPG.