Free SVG Optimizer

Shrink SVG files without changing how they look. Unsafe content is removed and listed, and both versions are rendered and compared.

Free, no signup. Defaults are lossless; riskier options are opt-in.

Input

Drop an .svg or .svgz hereor choose a file
or paste markup
Settings — defaults are lossless
Riskier options
✨

Nothing optimized yet

Add an SVG on the left. Unsafe content (scripts, event handlers, external resources) is removed and listed; the rest is optimized without changing how it looks — and checked by rendering both versions.

This is an optimizer with a defensive filter, not a security-audit guarantee.

How to optimize an SVG file

  1. Upload SVG/SVGZ or paste SVG markup. Keep conservative settings and reject unsafe content enabled.
  2. Review before/after size and PNG previews at both scales. Check text, gradients and clipping; precision reduction and removals are optional and can affect appearance.
  3. Download the optimized SVG only when the result suits your use. Keep the original if the output grows or the preview differs.

Unsafe markup is rejected by default. You can explicitly choose removal with a report. Preview comparisons are useful checks, not a guarantee in every renderer or a security audit.

Input is sent to Cubix's server for processing. The input limit is 2 MiB. Use sample data when trying the tool.

Working on a video too? Explore Cubix editing guides.

🪶

Lossless Defaults

Removes comments and editor data, collapses whitespace, and re-spells numbers and paths exactly.

🛡️

Sanitized

Scripts, event handlers, external references, and unsafe CSS are removed and each removal is listed with its line.

🔬

Visually Verified

Both versions are rendered at 1× and 4× and compared pixel by pixel, so you can see nothing changed.

Level up your editing workflow.

Get weekly insights on video editing, AI workflows, and creator growth straight to your inbox.

Join Newsletter

Frequently Asked Questions

Will optimizing change how my SVG looks?

Default settings preserve exact numeric values and avoid destructive removals. Review the before/after PNG previews at 1× and 4×; a preview match does not guarantee identical appearance in every renderer. Reducing precision is optional and can change appearance.

How is unsafe content handled?

<script>, on* event handler attributes, javascript: and non-image data: URLs, external references on use/image/feImage, external url() in CSS, @import, <foreignObject>, and similar. Unsafe content is rejected by default. If you turn off rejection, each removal is listed with its line.

What is never touched?

viewBox, ids (by default), gradient/clip/mask/pattern/filter structure, text content, title/desc, role/aria-* attributes, and anything marked xml:space="preserve".

Why did my file get bigger?

Files that are already minimal can grow slightly when quoting or escaping is normalised or a missing namespace is added. The tool says so clearly — you may prefer to keep the original.

Is the SVG optimizer free?

Yes. Optimize SVG files online for free with no signup and no watermark.