SVG Viewer
WM-135Paste SVG code to see the image it draws, along with its size in bytes and the width, height and viewBox on the root element. The image is drawn in a sandbox where scripts do not run.
Runs in your browser. Nothing is uploaded.
SVG code
Image
How to use it
- Paste SVG markup, or open an .svg file.
- Pick a checkerboard, white or black background to see transparent areas.
- Choose Fit the pane or Actual size.
- Read the size and dimensions in the status line.
How the image is drawn
The SVG is shown the way an <img> tag shows it, inside a sandboxed frame. Scripts and event handlers do not run, and linked files, external images and web fonts are not loaded, so the preview makes no requests. Animations written in SMIL or CSS still play; animations started by a click or hover do not. A web font that is not loaded falls back to a local font.
Size, dimensions and errors
The status line gives the size in bytes as UTF-8 and the width, height and viewBox written on the root <svg> element. If the code is not well-formed XML it says so and names the problem, since a browser may refuse to draw it. The tool does not optimize, minify or clean the SVG; Copy and Download give your code back unchanged.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
No <svg> element found. Paste SVG markup that starts with <svg or <?xml. | The input has no <svg> tag. | Paste the full SVG code, including the opening <svg> element. |
Questions people ask
How do I view SVG code as an image?
Paste the code that starts with <svg, or an XML declaration followed by <svg, into the input box. The picture appears straight away. Switch the background to see where it is transparent, and use Actual size to see it at its written width and height.
Why does my SVG not appear?
The most common causes are a missing xmlns="http://www.w3.org/2000/svg" attribute, XML errors such as an unclosed tag, or a width or height of zero. The status line reports XML problems. Images linked from other files are not loaded here.
Is it safe to preview an SVG from an unknown source?
The preview is drawn as an image in a sandboxed frame, so scripts and event handlers in the file do not run and no external files are fetched. Treat the code itself with care if you plan to use it inline elsewhere.
Does the viewer change or compress my SVG?
No. It only draws the image and reads a few facts about it. Copy SVG and Download give back exactly the code you pasted. Use an SVG optimizer if you need a smaller file.
Is my SVG uploaded?
No. The image is drawn from a data URL inside your browser, and the size and dimensions are read there too. The SVG code is not sent to a server and never leaves your device.
About this tool
The SVG is drawn as an image inside a sandboxed frame, the way an <img> tag shows it: scripts, event handlers and animations triggered by clicks do not run, and linked files, external images and web fonts are not loaded, so nothing leaves your browser. SMIL and CSS animations still play. The status line gives the size in bytes (UTF-8) and the width, height and viewBox written on the root <svg>, and warns when the code is not well-formed XML. Copy and Download give your SVG code unchanged; the tool does not optimize or clean it.