SVG optimizer — minify and clean vector markup for smaller, faster icons and illustrations

Use this free SVG minifier online to shrink logos, icons, and UI graphics before you commit them to a repo or inline them in HTML and components. The tool removes comments, strips whitespace between tags, optionally drops metadata and design-tool noise (common in Inkscape, Sketch, and Figma exports), shortens hex colors, and blocks script injection in the output. Everything runs in your browser with DOMParser—your files are not uploaded. After optimization, use the image to Base64 helper when you need a data URI for CSS or email, or open the image compressor for raster PNG and JPEG. Browse every utility in the file and data tools section on the home page.

Drag and drop an .svg here, or use .

Paste SVG or upload a file to generate minified markup.

Scripts are always removed from output for safety. Preview reflects optimized markup only—treat untrusted SVG like any other user content in production.

Why teams minify SVG for production websites and apps

Scalable Vector Graphics stay crisp at any resolution, which makes them ideal for icons, logos, charts, and illustrations. Exported files often contain verbose whitespace, XML comments, editor metadata, and redundant attributes that do not change how browsers paint the shape. An SVG optimizer trims that overhead so payloads are smaller, diffs in Git are cleaner, and pages parse slightly less text—especially when you ship dozens of inline symbols. This complements raster workflows handled by the image resizer and image format converter when your art direction mixes vector and bitmap assets.

Searchers look for compress SVG online, clean SVG from Figma, or reduce SVG file size without installing desktop apps. This page targets those workflows with paste-or-upload input, optional metadata stripping, and a one-click copy action beside the output (with the standard copy icon). If you need to verify binary integrity of any downloaded asset, follow up with the file hash checker.

How to use this SVG minifier (step by step)

  1. Click Upload SVG (upload icon), drag a file into the dashed drop zone, or paste raw markup into the input editor. The root element should be <svg>.
  2. Choose cleanup options: Remove metadata drops the metadata element; Strip editor attributes removes common tool-specific namespaces and attributes. Scripts are always stripped from the output.
  3. Review the preview and byte comparison. When the graphic looks correct, press Copy next to the optimized textarea to place minified SVG on the clipboard.
  4. Paste into your codebase, CMS, or sprite sheet. Use Clear to reset and process another file.

SVG optimization vs accessibility and SEO

Removing metadata rarely affects visuals. If you rely on title or desc elements for screen readers, keep your source file in version control and only strip what you have validated. For SEO, inline SVGs can include structured text, but decorative icons should use appropriate ARIA patterns in the surrounding HTML. This utility does not rewrite paths or merge shapes; it focuses on safe, reversible hygiene tasks you can audit quickly in the preview.

Security notes for SVG you did not author

SVG is XML. Malicious files may embed scripts or external references. This tool removes script tags and event-handler attributes such as onload, but you should still treat third-party SVG like any untrusted markup: review diffs, serve with a tight Content-Security-Policy where possible, and prefer referencing static assets from your own CDN.

Related file and developer tools

Explore the full file and data tools list. Highlights:

  • CSV Viewer & EditorOpen CSV as a sortable, filterable table, tweak cells, and export without a spreadsheet app.
  • CSV DeduplicatorRemove duplicate rows by chosen columns to clean mailing lists and product feeds.
  • CSV to SQL ConverterGenerate INSERT statements from a CSV for quick database seeding and migrations.
  • Image to Base64 ConverterEncode images to Base64 data URIs for embedding in HTML, CSS, or API payloads.
  • Image ResizerResize by pixels or percentage in the browser—privacy-friendly, no server upload required.
  • Image CompressorShrink JPG and PNG with quality control and before/after size stats for faster pages.
  • Image Format ConverterConvert between JPG, PNG, and WebP locally to match CMS, email, and performance needs.
  • Image Metadata ViewerInspect EXIF: camera, lens, GPS, dimensions, and exposure—great for photographers and forensics.
  • File Hash CheckerCompute MD5, SHA-1, and SHA-256 hashes of uploads to verify downloads and integrity.
  • Base64 encoder & decoderEncode text or files to Base64 when you need URL-safe variants beyond inline images.

Frequently asked questions

What does an SVG optimizer or minifier do?
It reduces SVG file size and noise by removing comments, stripping unnecessary whitespace between tags, dropping empty text nodes, optionally removing metadata and editor-specific attributes (Inkscape, Sketch, Figma exports), and shortening hex colors like #ffffff to #fff. The result is easier to cache, inline in HTML, or ship inside icon fonts and design systems.
Is my SVG uploaded to your servers?
No. Parsing and serialization run entirely in your browser with the DOMParser API. Nothing is sent to our backend for optimization.
Is this the same as SVGO?
SVGO is a Node-based toolchain with many more plugins (path simplification, merging paths, etc.). This tool focuses on fast, safe cleanup you can run without installing packages: valid XML output, script removal, and optional metadata/editor stripping. For deep path optimization in CI, many teams still run SVGO or similar in build pipelines.
Will minifying break my SVG or animations?
Whitespace between tags and comments do not affect rendering. Removing metadata or editor attributes is usually safe for production assets. If your file relies on SMIL animation, foreignObject, or embedded scripts, strip only what you understand—scripts are always removed here for safety. Test the preview before you deploy.
How do I use the optimized SVG in React or Next.js?
Copy the minified string into a component as JSX (rename reserved attributes like class to className), import as a raw file if your bundler supports it, or reference the file from /public. For inline data URIs in CSS, pair this page with /files/image-to-base64 after you save the SVG as a file, or paste inline if your stack allows.
Can I optimize SVG icons for the web and Core Web Vitals?
Smaller SVGs reduce download and parse cost, which supports LCP and overall payload budgets—especially when you inline many icons. Combine minification with HTTP caching, sprites or symbol defs where appropriate, and avoid inlining huge illustrations as data URIs. See also /files/image-compressor for raster assets.
Why remove Inkscape or Figma-specific attributes?
Design tools add editor metadata and namespaced attributes that browsers ignore at runtime. Removing them shrinks files and avoids leaking internal layer or grid data. Keep a master editable copy in your design repo; use the optimized export for production.