SVG Viewer
Preview SVG source against a transparency checkerboard, with its width, height, viewBox, XML declaration, and file size read directly from the source. The preview is sanitized with DOMPurify before rendering — an uploaded SVG can contain <script> tags and event handler attributes that would otherwise execute as real JavaScript — while copying or downloading always returns your original, untouched source. Runs entirely client-side — nothing is uploaded.
Could not parse this SVG.
About this tool
This tool renders SVG source and reports its key attributes: the declared width and height, the viewBox (the coordinate system the SVG's content is drawn in, which is what actually determines its visible aspect ratio when width/height are absent or set to percentages), whether it starts with an XML declaration, and its file size. Before rendering, the SVG is sanitized — an SVG file can contain <script> tags and on*= event handler attributes, both of which would execute as real JavaScript if injected into the page unfiltered, so this tool strips them before display rather than trusting arbitrary uploaded SVG content. The raw source you pasted or uploaded is left untouched for copying or downloading — only the rendered preview is sanitized. It runs entirely client-side — nothing you upload is ever sent anywhere.
What you can do
- Live preview against a transparency checkerboard, so transparent areas are actually visible
- Width, height, viewBox, XML declaration, and file size read from the source
- The preview is sanitized before rendering — embedded scripts and event handlers are stripped
- Copy the source or download it as a .svg file
How to use
Step 1
Add your SVG
Upload a .svg file, or paste the source directly.
Step 2
See it rendered
The preview and details update live as you edit the source.
Step 3
Copy or download
Get the source back as text, or as a downloadable .svg file.
Example
This SVG:
SVG
<svg viewBox="0 0 100 100"> <circle cx="50" cy="50" r="40" fill="#2563eb" /> </svg>
has no width/height attributes at all — its rendered size comes entirely from the viewBox and whatever CSS sizes its container, which is exactly the kind of detail this tool surfaces directly.
How your data is handled
This tool is labeled 🟢 Browser: your SVG is parsed, sanitized, and rendered directly in your browser using the DOMPurify library — nothing is uploaded to a server, and nothing about it is retained once you leave the page.
Frequently asked questions
Why sanitize the preview instead of rendering the SVG exactly as uploaded?+
An SVG file is allowed to contain <script> tags and event handler attributes like onload=, both of which would run as real JavaScript in the page the moment the SVG is displayed. Since this tool has to render whatever SVG you give it — including ones you didn't create yourself — those are stripped first for safety.
Does sanitizing change the file I download?+
No — sanitization only affects the live preview. Copying the source or downloading the file always gives back exactly what you pasted or uploaded, untouched.
Why does my SVG show no width or height?+
Not every SVG declares explicit width/height attributes — many rely entirely on the viewBox plus CSS sizing from whatever page embeds them. That's valid SVG, and this tool reports width/height as absent rather than guessing a value.
What's the checkerboard pattern behind my image?+
It indicates transparency — anywhere you see the checkerboard through the image is a transparent (or partially transparent) area of the SVG, the same convention image editors use.
Is my SVG uploaded anywhere?+
No — it's parsed, sanitized, and rendered directly in your browser. Nothing here ever leaves your device.