SVG cleaner
SVG cleaner for browser-based cleanup
Use this SVG cleaner to paste SVG markup, remove risky tags and attributes, preview the result, and download a cleaned file. The SVG stays on your device.
SVG cleaner
Paste an SVG document below. The sanitizer runs locally and keeps a conservative set of SVG tags and attributes.
Clean SVG code before it goes into a project
SVG is code. A file copied from an export tool, icon pack, or unknown source can contain scripts, event handlers, external links, or markup your app does not need. Cleaning it makes the file easier to review and safer to paste into a project.
Use this SVG cleaner when you need to remove script from SVG files, strip unsafe attributes such as onclick, or prepare SVG markup before using it in a website or React component. The cleaner keeps a conservative set of SVG tags and attributes so the output stays readable.
Working with React? Start with cleanup, then use the SVG to React converter or read the React SVG cleanup guide.
Common questions
Does the SVG cleaner upload my file?
No. The cleaner runs in the browser. Your pasted SVG is not sent to a server for cleaning.
Can this SVG cleaner remove script from SVG files?
It removes scripts, event attributes such as onclick, unsafe links, unsupported tags, and other markup that can cause security or rendering problems.
Can I use the cleaned SVG in React?
Yes. Clean the SVG first, then use the SVG to React tool to convert common SVG attributes into JSX-friendly names.