Make an SVG safe to use SVGCLEAN
Takes an SVG apart with the browser's own parser and puts back only what draws: script, event handlers, embedded HTML and references to other servers are removed.
The file
Drop an .svg here, or
What was in it
Before and after
Both are drawn through an image tag, so the untouched file is safe to look at.
As it arrived
Cleaned
What to take out
Script, event handlers, embedded HTML and outside references are always removed, whatever is ticked here.
The clean markup
How it works
An SVG image is a document that can contain scripts, event handlers, embedded HTML and links to other servers, which is why many sites refuse SVG uploads. SVGCLEAN takes an SVG apart with the browser's own parser and puts back only what draws, so the cleaned file looks the same but carries nothing that can run. Titles, descriptions and metadata are removed by default, which is usually where a name sits. The file is processed in your browser.
The guide: How to check a PDF for malware without uploading it
Questions people ask about SVGCLEAN
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.
Doing this often? OBSCURA Vector opens the cleaned SVG to edit it, with layers, the pen and Pathfinder, and writes it back as SVG. Everything is US$5 a month or US$48 a year.