SVG Viewer & Editor
View, edit, format and optimise SVG code with a live preview.
View, edit and optimise SVG files with a live preview. Open an SVG or paste its code, and the drawing appears beside the code, updating as you type. Check its width, height and viewBox, view it on a checkerboard, white or black background and zoom in to inspect details. Format messy code with neat indents, or optimise it: comments, metadata and drawing-app data (Inkscape, Illustrator, Sketch, Affinity) are removed, coordinates rounded and the code put on one line. Then download the SVG, copy the code, or export a PNG at any width. Everything runs in your browser, so your files are never uploaded, and there's no sign-up or watermark.
Or paste or type SVG code below. Nothing is uploaded.
Common use cases
- Check what an SVG file looks like without opening a design app
- Tweak colours, sizes or paths by hand and see the result immediately
- Shrink SVG icons before adding them to a website
- Export an SVG as a PNG at the exact width you need
How to use
- Open an SVG file, or paste or type SVG code into the editor.
- Change the background or zoom to inspect the preview.
- Press Format to tidy the code, or Optimise to make it smaller.
- Download the SVG, copy the code, or set a width and download a PNG.
FAQ
What does Optimise remove?
Comments, the <metadata> block, the extra data Inkscape, Illustrator, Sketch and Affinity save for themselves, and empty groups and defs. Numbers in coordinates are rounded to the decimal places you choose. Titles and descriptions are kept unless you tick the box, because screen readers use them.
Can optimising change how the SVG looks?
Rounding to fewer decimal places can shift points very slightly. 3 decimal places is invisible for almost any drawing; check the preview after using 1 or 2. Choose Don't round to leave numbers alone.
Is it safe to open an SVG from somewhere else?
The preview draws the SVG as an image, so any scripts inside it don't run. The code is shown as text and never sent anywhere.
Why does it say my SVG isn't valid?
SVG is XML, so every tag must be closed and attribute values quoted. The message points to the line where the problem starts.
Can I draw shapes with the mouse?
No. This is a code editor with a live preview. To draw, use a vector app such as Inkscape or Figma, then open the SVG here to check or optimise it.
Related tools
- SVG ConverterSVG converter: turn PNG, JPG and other images into SVG vectors, or convert SVG files to PNG, JPG or WebP at…
- SVG to PNG ConverterConvert SVG files to PNG at any width, crisp and with transparent backgrounds kept. Batch convert icons and…
- PNG to SVG ConverterConvert PNG to SVG: trace logos, icons and drawings into scalable vector paths, choose colours and detail…
- Image to Base64Convert images to Base64 encoded strings for embedding in HTML or CSS.
- Base64 to ImageConvert Base64 encoded strings back to downloadable image files.
- Image CropperCrop images by dragging or by exact pixels, with 1:1, 4:5, 16:9, 9:16, 4:3 and 3:2 ratios. Save as JPG, PNG…