Skip to main content

SVG Editor & Inspector

Edit SVG source, browse the element tree and preview it safely

SVG source

SVG source editor

Paste or open SVG markup. It stays in this tab and is not saved.

Elements

Paste SVG markup to inspect it
The element tree, the sanitizer report and a safe preview appear here.

Preview

Nothing to preview yet
Valid SVG markup renders here after sanitizing.

How to use

  1. 1.Paste SVG markup, open an .svg file or load an example.
  2. 2.Browse the element tree with the mouse or the arrow keys; selecting an element outlines it in the preview and highlights its tag in the source.
  3. 3.Check the element panel for fill, stroke, transform, geometry, path data and the bounding box.
  4. 4.Use Format or Minify to tidy the source, then copy or download it, or export the sanitized SVG to JSX, an image or a Data URI.

What is the SVG Editor & Inspector?

A local workspace for SVG markup: edit the source with syntax highlighting, browse every element in a tree, inspect attributes, presentation values, path data and bounding boxes, and see a safe preview. It connects the SVG tools on this site: send a path to the SVG Path Debugger, convert the document to JSX, or export it as an image.

Safe preview

The preview never renders your source directly. The markup is sanitized first (scripts, event handlers, foreignObject, external references and script URLs are removed), then drawn from the sanitized element tree with a second defensive filter. The sanitizer report lists everything that was removed, with its line in the source.

Privacy and limits

Everything runs in your browser; the SVG is not uploaded or saved. Files up to 5 MB are supported. The tree lists up to 5,000 elements and the preview turns off above 20,000 elements. Styles from style blocks and CSS classes are not applied, because style elements are removed by the sanitizer.

Frequently asked questions
Can an SVG with scripts run code in the preview?
No. The preview never renders your source. The markup is sanitized first, removing scripts, event handlers such as onload and onclick, foreignObject, external references and javascript: URLs, and the result is drawn from the sanitized element tree with a second defensive filter. The sanitizer report lists everything that was removed.
How do I find an element in a large SVG?
Browse the element tree with the arrow keys or click the shape in the preview. Selecting an element outlines it on the canvas, highlights its start tag in the source editor and shows its attributes, transform, geometry, path data and bounding box.
Is my SVG uploaded or saved?
No. Editing, sanitizing and previewing run in your browser, and the source is not stored. Sending the SVG to SVG to JSX, SVG to Image, the SVG Path Debugger or the Data URI Inspector passes it in memory to the next page only.

CodingTool is officially live on