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

Paste an SVG or drop an .svg file. Scripts and external references are stripped.

viewBox
0 0 24 24
Dimensions
24×24
Elements
2
Shapes
1
Colours
#2563eb
Findings
none

Supported formats

Input
svg, text
Output
svg, text
Files
Local file intake and drag/drop

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

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

  1. Sanitize the markup conservatively: strip script elements, event-handler attributes, foreignObject, DOCTYPE/entities and javascript:/external references.
  2. Summarize the cleaned markup with a structural scan: viewBox, width/height, element and shape counts, and declared fill/stroke colours.
  3. Report every removal as a named finding so the preview is never silently altered.

Usage

  1. Paste an SVG or drop an .svg file.
  2. Read the sanitized source and the structural summary.
  3. 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

jsonSelect to copy
{
  "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

jsonSelect to copy
{
  "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

  1. Scalable Vector Graphics (SVG) 1.1 Specification — W3C