Settings

The file

Drop an .svg here, or

What this is, and what it is not

It keeps what draws, rather than removing what is known to be bad. A list of dangerous elements is a list of the ones somebody thought of, and SVG has a great many elements. This works the other way round: the shapes, the gradients, the filters and the text are allowed through and everything else is removed and named. A new attack in a tag nobody has heard of is removed because it is not on the list.

A reference that points outside the file is a read receipt. An image, a font or a stylesheet fetched from another server tells whoever runs it that the file was opened, roughly from where, and when. Inside a logo that is a beacon. References that point inside the same file, which is how gradients and masks work, are left alone.

The parser is the browser's own. Markup is parsed as XML rather than matched with regular expressions, because a regular expression over markup is exactly how a script tag gets missed. If the file will not parse, the page says so instead of half-cleaning it.

Look at the two pictures. The original and the cleaned file are drawn side by side, both through an image tag, which cannot run script or fetch anything. If the cleaned one is missing part of the drawing, one of the boxes is taking out more than you wanted, and you can see that rather than discover it later.

Nothing is uploaded. The file is read in the tab and written back out of it. Turn the network off and the page works the same, which for a tool about files that fetch things quietly is the point.

Questions people ask

Why do sites refuse SVG uploads?

Because an SVG served back from a site runs as part of that site. A script inside one becomes script on that domain, with access to whatever a page there can reach. A cleaned SVG does not have that problem, which is why cleaning is the alternative to refusing.

What is actually dangerous in an SVG?

Script elements, any attribute beginning with on, embedded HTML through foreignObject, links with a javascript: URL, and CSS that imports or fetches. Each of those is either code that runs or a request that happens without being asked for.

Will cleaning change how it looks?

It should not. What is removed is script, handlers, remote references and the editor's own bookkeeping, none of which draw. The one visible change is where the file depended on fetching an image or a font from elsewhere, in which case that part cannot appear anyway on a machine that is offline or behind a firewall.

Does it remove the artist's name?

Titles, descriptions and metadata come out by default, and those are usually where a name sits. It does not strip a name that is drawn as part of the artwork, because that is the drawing. Untick the box if the file is going somewhere those details belong.

Is it safe to open the file here at all?

Yes. The original is shown through an image tag rather than inline, and a browser will not run script, follow links or fetch remote references in an SVG loaded that way. The cleaning itself works on a parsed document that is never attached to this page.

Related tools