SVG Inspector

See what an SVG file contains before you use it: its width, height, viewBox and aspect ratio, how many of each element it has, every colour and font it uses, and whether it has a title for screen readers. The safety report flags scripts, event handlers, javascript: links, embedded HTML and files loaded from other sites. The SVG is shown as an image, where browsers never run scripts, and it is read on your device: nothing is uploaded.

Loading image tool...

Features

  • Size, viewBox, aspect ratio and element count

  • Element breakdown (path, g, circle, text...) and every colour used, with swatches

  • Fonts the SVG expects, and whether it has a <title>

  • Safety report: scripts, on* event handlers, javascript: links, <foreignObject>, embeds and outside links

  • Notes on editor leftovers that the optimiser can remove

Who inspects SVGs

Developers accepting uploads

Check whether a user-supplied SVG carries scripts or outside links before allowing it.

Designers handing off icons

Confirm every icon has a viewBox, uses the right colours and has no stray fonts.

Brand checks

List the exact colours in a logo SVG to match them elsewhere.

Reading the report

Danger, warning and info

  • Danger: <script> elements, event handler attributes (onload, onclick...) and javascript: links. These run code if the SVG is opened directly or inlined in a page.
  • Warning: <foreignObject> (embedded HTML), frames and objects, and links to images, fonts or styles on other sites.
  • Info: embedded raster images, animations and text elements, which are fine but worth knowing about.

viewBox matters

The viewBox defines the SVG's own coordinate system. Without it, the SVG cannot scale cleanly with CSS. If the report says it is missing, the optimiser can add one from the width and height.

Text in SVGs

Text elements need the named font on the viewer's device, or they fall back to another font. For logos, convert text to outlines (paths) in your design app before exporting.

Related tools

SVG Inspector - FAQ