SVG Viewer

Render an SVG safely, inspect its size, and view the code.

A free online SVG viewer — upload, drag in, or paste SVG markup to render it, sanitized of scripts and event handlers first. No signup, everything runs in your browser.

What does an SVG viewer do?

An SVG viewer renders SVG markup as an image without needing a design tool or a browser tab you trust enough to open the raw file in. Because SVG is XML that can embed live <script> tags and event handlers, this tool strips anything executable before rendering, so you can safely preview an SVG from an untrusted source, inspect its dimensions, and read the formatted source code.

Why SVG rendering needs sanitizing

Unlike PNG or JPG, an SVG file is a text-based XML document that a browser can execute like a limited webpage — it can contain <script> elements and onload/onclick attributes that run JavaScript the moment the file is displayed. Before this tool renders anything, it parses the markup and removes scripts, event-handler attributes, <foreignObject> elements, and external references — so an untrusted SVG can be previewed without risk.

Intrinsic size vs viewBox

An SVG's rendered size is set by its width/height attributes if present, falling back to the viewBox dimensions, and finally to the browser default of 300×150 if neither is set. The viewer shows both so you can see exactly which values are driving the display size.

Common uses

Quickly checking what an SVG icon or illustration looks like before dropping it into a project, safely previewing an SVG downloaded from an unfamiliar source, inspecting the raw markup of an exported design asset, or verifying a viewBox is set correctly.

Frequently asked questions

How do I view an SVG file?

Upload or drag in an .svg file, or paste raw SVG markup into the text box. The rendered image appears immediately, along with its intrinsic size and viewBox.

Is it safe to view an SVG from an untrusted source?

SVG files can contain embedded <script> tags and event handlers that would normally execute like a webpage. Before rendering anything, this tool strips scripts, event-handler attributes, foreignObject elements, and external references, so the preview can't run code from the file.

Can I see the SVG's source code?

Yes — switch to the Code tab to see the formatted (sanitized) SVG markup, and copy it with one click.

Is my file uploaded anywhere?

No. Parsing and rendering happen locally in your browser — your SVG never leaves your device, and nothing is stored on a server.

Related tools: SVG to PNG · SVG Background Remover · XML Formatter