How to use the SVG viewer
- Paste SVG code, drop an .svg file on the code panel, or press Open.
- Edit the code; the preview updates as you type. Change the background or zoom to inspect it.
- Format or Minify the code, then download it as SVG or PNG, or copy a data URI for CSS.
SVG basics
| Element | Draws | Example |
|---|---|---|
<rect> | Rectangle | <rect x="10" y="10" width="80" height="40" rx="6"/> |
<circle> | Circle | <circle cx="50" cy="50" r="40"/> |
<line> | Straight line | <line x1="0" y1="0" x2="100" y2="100" stroke="black"/> |
<path> | Any shape | <path d="M10 80 Q 50 10 90 80"/> |
<text> | Text | <text x="10" y="30">Hello</text> |
The viewBox attribute sets the coordinate system, so the drawing scales to any width and height without losing quality. For bitmaps, use the image resizer; to embed small images as text, try Base64.
Frequently asked questions
Drop the file on the editor, open it with the button, or paste the SVG code. The preview updates as you type, so you can edit the code and see the result straight away.
Yes. SVG files can contain scripts, so the preview is rendered as an image, where browsers never run scripts or load external resources. The file stays in your browser and is never uploaded.
Open or paste the SVG, choose a width for the PNG, and press PNG. The image is rendered at that size, so it stays sharp; vector graphics can be exported at any resolution.
Common causes: the code is missing the xmlns="http://www.w3.org/2000/svg" attribute (the editor adds it when it can), a tag isn't closed, or the SVG has no width, height or viewBox, so it renders at zero size. The status line under the editor reports parse errors.
The SVG encoded into a URL, like data:image/svg+xml,…, which you can put directly in CSS background-image or an img src without a separate file. The editor creates a URL-encoded version, which is smaller than Base64 for SVG.