SVG Viewer
Preview an SVG safely and inspect its structure — viewBox, dimensions, shapes and colours.
- Runs locally in your browser
- No upload required
Capabilities
- Drag and drop
- Local file intake
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Sanitized an SVG with 2 element(s), 1 shape(s) and 1 colour(s).
How it works
- Remove scripts, event handlers, foreignObject and external references.
- Summarize the markup: viewBox, width/height, element and shape counts, declared colours.
- Report any parse or sanitization finding without throwing.
- Rendering happens safely in your browser; the source is never uploaded.
Methodology
- Sanitize the markup conservatively: strip script elements, event-handler attributes, foreignObject, DOCTYPE/entities and javascript:/external references.
- Summarize the cleaned markup with a structural scan: viewBox, width/height, element and shape counts, and declared fill/stroke colours.
- Report every removal as a named finding so the preview is never silently altered.
Usage
- Paste an SVG or drop an .svg file.
- Read the sanitized source and the structural summary.
- Copy the sanitized markup if you want the cleaned version.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
A single circle
{
"source": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"24\" height=\"24\"><circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"#2563eb\"/></svg>"
}A scripted SVG is sanitized
{
"source": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\"><script>alert(1)</script><rect width=\"10\" height=\"10\" fill=\"#10b981\"/></svg>"
}Limitations
Safe preview
SVG is markup that can carry scripts and external resources. The viewer strips those before producing a preview, so pasting an untrusted SVG is safe. Each removal is listed as a finding.
Alongside the preview, the viewer reports a structural summary so you can confirm an icon's viewBox, dimensions and colour set without opening a design tool.
Frequently asked questions
- Will a script inside the SVG run?
- No. The sanitizer removes script elements and event handlers before anything renders, and external references are stripped.
- Are my colours exact?
- The tool reports the colour keywords/values it finds in fill, stroke, stop-color and color attributes, without normalising them.
Sources
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.