Validate, repair, optimize and preview SVG files. Catches XML errors, unsafe scripts, external refs and contrast issues.
Drop an SVG file here
or click to browse
XML well-formedness, correct root element, xmlns and viewBox presence, embedded scripts, on* event attributes, external references, empty groups, missing <title>, and file size.
Adds xmlns="http://www.w3.org/2000/svg" if absent, derives viewBox from width/height if both are present, and removes empty unnamed <g> elements.
Removes all <script> elements, strips on* event attributes from every element, and removes javascript: href values. Does not alter valid SVG content.
Runs SVGO multipass over the SVG — removes comments, metadata, unused defs, optimises path data and numeric precision, merges transforms. Loaded on demand the first time you click Optimize.
Produces a base64-encoded data:image/svg+xml string. Paste it directly into CSS background-image: url(…) or an <img src> attribute without needing a separate file on a server.
When the dark preview background is active, validation flags elements with black or default (inherited black) fill — these would be invisible on a dark background. Switch to the dark preview bg to trigger the check.
No. Everything — validation, repair, sanitize, minify, pretty-print, optimize, and preview — runs entirely in your browser. No files or data leave your device.
Keywords: SVG validator, SVG repair, SVGO optimize, SVG preview, SVG sanitize, xmlns missing, viewBox missing, SVG minify, SVG pretty print, data URI, in-browser SVG tool