SVG Viewer & Inspector
Paste SVG markup or drop in an .svg file to render it live, read its width, height, and viewBox, and check the element count — a quick, private SVG inspector that runs entirely in your browser.
Updated
How to use SVG Viewer & Inspector
The SVG Viewer renders SVG markup live and reports its key attributes so you can inspect vector graphics quickly. Paste SVG code or upload an .svg file and see it rendered immediately alongside its width, height, viewBox, and a count of drawable elements. The file is read locally with the browser FileReader API and rendered inline, so your graphic never leaves your device.
- Upload an .svg file or paste the SVG markup into the box.
- View the rendered graphic in the preview panel.
- Read the width, height, viewBox, and element count details.
- Copy the markup if you want to reuse it elsewhere.
Your data never leaves your device — 100% private processing.
Understanding the viewBox
The viewBox attribute defines the coordinate system of an SVG as four numbers: min-x, min-y, width, and height. It controls how the vector content maps into whatever pixel size the SVG is displayed at, which is why an SVG can scale crisply to any size. When an icon appears cropped, off-centre, or zoomed, the viewBox is usually the culprit, so seeing it explicitly helps you diagnose and fix layout problems fast.
Width, height, and element count
The width and height attributes set the intrinsic display size, though CSS can override them. The element count totals the drawable shapes — paths, rectangles, circles, groups, text, and more — giving you a quick sense of the graphic's complexity. A surprisingly high count can hint at an unoptimised export with redundant nodes that you may want to simplify before shipping.
Worked examples
Read the viewBox
Inputs: <svg viewBox="0 0 24 24">…
Result: viewBox shown as 0 0 24 24
Count elements
Inputs: <svg><path/><circle/></svg>
Result: Element count reported as 2
Upload a file
Inputs: Choose icon.svg
Result: Graphic rendered with its details listed
Glossary
- SVG
- Scalable Vector Graphics: an XML-based format for resolution-independent images defined by shapes and paths.
- viewBox
- An attribute defining the SVG coordinate system and how its content scales into the display area.
- Path
- An SVG element that draws an arbitrary shape from a series of line and curve commands.
- FileReader
- A browser API that reads local file contents without uploading them to a server.
Related reading
Frequently Asked Questions
Get weekly tool tips & updates
New tools, power-user tips, and productivity hacks — delivered free every Friday.
No spam, ever. Unsubscribe with one click.
Why use SVG Viewer & Inspector?
- Render SVG markup or an uploaded .svg file instantly
- Read the width, height, and viewBox at a glance
- See how many drawable shape elements the graphic contains
- Copy the markup back out after inspecting it
- Files are read locally — your graphic is never uploaded
Common use cases
- Check how an exported icon looks before adding it to a project
- Inspect the viewBox of an SVG to fix scaling or cropping issues
- Verify markup produced by a design tool or AI before shipping it
- Quickly preview an icon pasted from a component library
- Confirm an SVG has no unexpected extra elements
Related Developer Tools
SVG ↔ PNG Converter
Convert SVG to PNG at any resolution, or trace a PNG into an embeddable SVG. Free, private SVG/PNG converter that runs entirely in your browser.
HTML Viewer & Previewer
Paste HTML and preview the rendered result instantly in a safe sandbox. Toggle between rendered output and formatted source — free, private, and in your browser.
CSS Minifier & Beautifier
Minify and beautify CSS code online. Reduce CSS file size by removing whitespace and comments. Free online CSS minifier with instant results.
JSON Formatter & Validator
Format, validate, and minify JSON instantly. Includes syntax highlighting, error detection, and a collapsible tree view — free, private, in-browser.
Regex Tester
Test and debug regular expressions online. See live matches, capture groups, and replace output. Free, private, instant.
Base64 Encoder & Decoder
Encode text or files to Base64, or decode Base64 strings back to text. Fast, free, and runs entirely in your browser.
Explore all Developer Tools.