Sanitize SVG markup

Clean SVG Online

Clean an SVG: strip scripts, javascript: URLs, and event handlers, and tidy markup so the file is safer to share or embed. Free, up to 70 MB.

Drop file or click to browse

Accepts .svg — max 70 MB

What gets cleaned

  • Scripts & handlers gone

    <script>, onclick/onload, and javascript: URLs stripped

  • Visual identity kept

    Paths, fills, strokes, viewBox, gradients, and embeds unchanged

  • Editor junk removed

    Inkscape/Sodipodi metadata and comments dropped when safe

  • Responsive when safe

    Fixed width/height removed only when viewBox already exists

How to clean an SVG file

📤

Upload an SVG

Drop a .svg file that may contain scripts or leftover editor markup.

Run Clean SVG

The sanitizer removes scripts and unsafe handlers on an allowlist — it is not a visual redraw.

💾

Download the cleaned SVG

Preview and save the sanitized file for the web or a design handoff.

ConversionBest for
PNG → SVGIcons, logos, illustrations and line art
JPG → SVGPhotos and illustrations with clear edges
PNG → JPGPhotos that need JPEG at original size
JPG → PNGLossless PNG from a JPEG at original size
SVG → PNGExport at any pixel size for web or print
PDF → SVGExtract and convert individual pages from a PDF
Clean SVGRemove scripts, fix viewBox and sanitize output
Customize SVGRecolor, rotate, background, then download PNG or SVG

Teams search for a way to clean SVG or sanitize SVG before putting markup on a site. This Clean SVG tool strips scripts and handlers so the download is safer to embed, without tracing or recoloring the artwork.

Sanitize, do not restyle

Clean SVG is the right tool when the question is “does this file contain script?” not “can I change the color?” Recolor, rotation, and PNG export live on Customize SVG. Conversion from PNG or JPG lives on those converter pages.

Safer SVG for the web

Exported SVGs from some editors still include leftover script or event attributes. Running Clean SVG before you ship an icon set or a blog embed is a simple hygiene step. The cleaned file remains SVG so you can keep editing it.

Frequently asked questions

What does Clean SVG remove?

Scripts, javascript: URLs, and inline event handlers such as onclick. The goal is a safer SVG, not a different drawing.

Is this an SVG optimizer like SVGO?

No. Clean SVG is a sanitizer. It does not minify path data or change how the icon looks. Use it when you need scripts gone, not a smaller aesthetic rewrite.

Will cleaning change colors or shapes?

Visual identity is preserved. Cleaning targets unsafe markup, not fills, strokes, or layout.

Can I clean a large SVG?

Yes. The same 70 MB upload cap applies.

When should I clean SVG before customizing?

If the file came from an unknown generator or old export, clean it first, then use Customize SVG to recolor or export PNG.