Preview
Export as:
Key benefits
- •Paste SVG straight from your code editor, a Figma export or the docs; no need to save a file first
- •See a live preview before converting and catch broken SVG early
- •Export to PNG (transparent background), JPG or WEBP
- •Free, and the pasted code is deleted right after conversion
Common uses
- •Turn SVG icons and logos (from Figma, Illustrator or an icon library) into images for slides and documents
- •Check what an SVG you're editing looks like before you put it on a website
- •Make preview images of SVG generated by code (charts, badges, banners) without a design tool
Getting SVG code to render correctly
The code must include a complete <svg> element, and a missing xmlns attribute is the most common reason a snippet works inside a web page but not on its own. Browsers forgive this in HTML, while a standalone renderer does not. If the preview stays empty, add xmlns="http://www.w3.org/2000/svg" to the opening tag.
Snippets copied from a React project can fail for a similar reason: JSX attributes such as strokeWidth and className aren't valid SVG. Change them to stroke-width and class. Styles or fonts defined in your site's CSS won't apply either, because only the pasted code is rendered, so colors set with currentColor or CSS variables may come out black.
Controlling the output size
Rendering happens at 300 DPI, so the width in your code is multiplied by about 4.17. To export a PNG about 512 px wide, set the width attribute to 123. A viewBox alone sets the proportions, so give the element an explicit width and height whenever the exact pixel size matters.
For a background-free icon, choose PNG or WEBP. JPG fills any unpainted area with white, which suits a chart headed for a document better than an icon headed for a colored slide.
Frequently asked questions
How do I use SVG Code to Image?
Paste your <svg>...</svg> code into the box on the left and the preview appears on the right. Pick an output format (PNG, JPG or WEBP), then click Export to download the image.
Do I need an .svg file?
No. That's the difference from a regular SVG to PNG converter: you only paste the SVG code as text, without uploading a file.
Should I choose PNG, JPG or WEBP?
PNG keeps transparent backgrounds, which suits logos and icons. JPG gives a small file when you don't need transparency (transparent areas become white). WEBP balances small size and high quality and also keeps transparency.
How big will the exported image be?
The SVG is rendered at 300 DPI, about 4 times its size in CSS pixels. For example, an SVG 200 pixels wide becomes an image about 833 pixels wide, sharp enough for slides and print.
Will custom fonts (like Google Fonts) render correctly?
If the SVG uses a font that isn't embedded in it, the text is drawn with a fallback font and the spacing may shift slightly. For an exact result, convert text to paths (outlines) before pasting the code.
Is the SVG code I paste stored?
No. The code is only processed for the conversion and deleted straight afterwards.
Helpful articles
Read the blog →
SVG vs PNG: Vector vs Raster Images Explained
Why a logo stays sharp at any zoom level while a PNG turns blurry, and how to pick between SVG and PNG.
How to Add a Favicon to Your Website: HTML, WordPress & More
Copy-paste favicon HTML, where the files go, and the steps for WordPress, Shopify, Wix, React and Next.js.
Favicon Size and Format Guide: ICO, PNG or SVG?
The favicon sizes every site needs, why favicon.ico still matters, and when an SVG favicon is the better choice.
Related tools
All tools →SVG to PNG
Turn SVG vector files into high-resolution PNG images that keep their transparent background.
IMAGESVG CODEImage to SVG code
Upload an image, get <svg> code to copy
PNGWEBPPNG to WEBP
Convert heavy PNG images to lightweight WEBP files that keep their transparent backgrounds.
IMAGESVGConvert images to vector SVG
Trace PNG and JPG images into real vector SVG paths that scale to any size without blurring.