SVG Editor

Paste SVG code to preview, clean, format or minify it, set width and height, and remove scripts and unsafe parts. In-browser.

Runs in your browserNo sign-upWorks offline
Ctrl+Enter to run
Input79 characters
Output
✓ ReadySample content shown

What the SVG Editor does

The SVG Editor previews, cleans and tidies SVG code. Paste markup or open an .svg file and see it drawn instantly. The editor removes scripts, event handlers, embedded HTML and links to other sites, strips comments and editor leftovers, and gives you formatted or minified output. You can also set or remove the width and height.

How to use it

  1. Paste SVG code into the box, or press Open .svg file.
  2. Check the preview on the right.
  3. Choose Formatted for readable code or Minified for the smallest file.
  4. Set a width and height, or tick Remove width and height so the SVG scales to fit its container. Copy or download the result.

Example

A designer exports an icon that is 4 KB, full of editor comments and extra attributes, with fixed 512-pixel width and height. Paste it in, choose Minified and remove the width and height: the cleaned file is a fraction of the size and scales to whatever size your CSS gives it. The status line shows the bytes before and after.

Why cleaning matters

SVG files can contain scripts and event handlers that run when the file is opened in a browser, which is a security risk when you use SVGs from unknown sources. The editor removes them and reports how many unsafe parts it found. The preview is shown as an image, where browsers never run scripts, so even a hostile file cannot do anything here.

Minifying removes comments, empty space and tags such as metadata that design apps add. Shapes, colours and paths are kept exactly.

Questions people ask

Is my SVG uploaded?

No. Files are read and processed in your browser and never uploaded.

Will minifying change how my SVG looks?

No. Only comments, spacing and editor data are removed.

Why does my SVG not show?

The status line explains parsing errors, such as a tag that is not closed.

Can I change colours?

Use Icon Recolor, which lists every colour in the file.

Related tools