svg sanitizer

Sanitize SVG before preview or production

Treat pasted SVG as untrusted input. Validate and preview only cleaned SVG before copying or downloading it.

svg sanitizer tool

Sanitize SVG

Paste SVG and receive safe preview plus cleaned output.

Ready

Download output

Block active content

Reject script elements, inline event handlers, foreignObject, unsafe XML, and external references.

Keep useful vector shapes

Preserve normal SVG paths, shapes, titles, fills, strokes, and viewBox attributes.

Review clear results

See the cleaned SVG and validation status before using third-party assets.

Sanitizer-safe example

Simple shapes, title text, and local attributes are preserved.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 96" role="img"><title>Check badge</title><rect width="160" height="96" rx="14" fill="#0e7c66"/><path d="M39 55l18 18 64-64" fill="none" stroke="white" stroke-width="10" stroke-linecap="round" stroke-linejoin="round"/></svg>

SVG Sanitizer FAQ

Why sanitize SVG?

SVG is XML and can include browser-executable or externally loaded content.

What does the sanitizer reject?

It rejects scripts, event handlers, dangerous embedded content, external references, unsafe XML, and oversized payloads.