SVG Viewer
Open and preview SVG files safely — markup is sanitized with the DOMPurify SVG profile (scripts and event handlers stripped) before rendering.
Reviewed 17 November 2026 · Free · No account needed
How to use
- Upload an .svg file or paste markup.
- The sanitized preview renders with reported dimensions.
- Malformed input is rejected with a clear message.
Example
Input: A 24×24 icon SVG
Output: Rendered preview · reported 24 × 24
How it works
The SVG markup is sanitized with DOMPurify using its SVG profile — scripts, event handlers and foreign content are stripped — and only the cleaned markup is rendered.
The markup must contain an <svg> element; it is sanitised with DOMPurify's SVG profile — scripts, event handlers and foreignObject content are stripped — and only the cleaned markup is rendered. Declared width and height are reported, falling back to the viewBox when the size attributes are missing.
A 24×24 icon SVG renders in the preview with "24 × 24" shown as its dimensions.
Edge cases to know
- Scripts, event attributes and foreignObject content are removed before anything renders.
- Input without an <svg> element is rejected with a clear message.
- Dimensions fall back to the viewBox when width/height attributes are absent.
- Very large SVGs (megabytes of paths) render slowly on low-memory devices.
Limits & compatibility
- Sanitized rendering: scripts, foreignObject and event attributes are removed.
- Animation (SMIL/CSS) may render but is not the focus.
- Very large SVGs (MBs of paths) render slowly on old devices.
Privacy
Preview happens locally in your browser. Your file is never uploaded or stored.
Related tools
Questions about SVG Viewer
Is it safe to open an SVG from an unknown source?
Reasonably, yes — the markup is sanitised with the DOMPurify SVG profile before anything renders, so scripts, foreignObject elements and event handler attributes are stripped. That removes the known script-execution routes in SVG. The file is also handled entirely in your browser: nothing is uploaded, so untrusted files never leave your device either.
What else does it report besides the picture?
The declared dimensions, read from the width and height attributes or derived from the viewBox when those are missing. Input must actually contain an <svg> element — anything else is rejected with a message rather than silently rendered blank. You can upload an .svg file or paste markup directly.
Do SMIL and CSS animations play in the preview?
They may render, but animation is not the focus — treat the preview as a still check of shape, colour and dimensions. Very large SVGs with megabytes of path data render slowly on older devices, because the whole document is parsed and drawn in the tab rather than by a native viewer.