Skip to main content

SVG Viewer

Runs locally

Inspect sanitized SVG graphics with zoom, background toggle, dimensions and PNG export.

What is SVG Viewer?

Safely inspect SVG files with DOMPurify sanitization, zoom controls, transparent checkerboard / dark / light background toggles, viewBox diagnostics, and instant PNG export.

How to use SVG Viewer

  1. Step 1

    Paste SVG code or drop an .svg file.

  2. Step 2

    Toggle background and zoom to inspect edges.

  3. Step 3

    Optimize with SVGO or download as PNG/SVG.

Features

  • DOMPurify sanitized SVG rendering
  • Checkerboard, dark, and light canvas backgrounds
  • Zoom controls and viewBox inspection
  • Export to PNG or React JSX

Example

Input

<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/></svg>

Output

Sanitized SVG preview + PNG export

Inspects geometry safely without executing embedded scripts.

Frequently asked questions

Is SVG Viewer safe for untrusted SVGs?

Yes, SVGs are sanitized with DOMPurify before rendering.

Can I export the preview as PNG?

Yes, click Export PNG in the preview toolbar.

Can I optimize the SVG here?

Yes, switch mode to Optimize (SVGO).

Are SVGs uploaded?

No, everything runs locally.