Turn SVG code into a PNG or JPG

Paste SVG markup or upload an .svg file. Download PNG (keeps transparency) or JPG (white background) at 500–2000 px. Conversion runs in your browser. Nothing is uploaded.

SVG code

Paste SVG markup (must contain an <svg> element) or upload a file up to 500 KB. Your code stays in your browser and is never sent to a server.

Preview

Your SVG will appear here once you paste or upload code.

PNG preserves transparency. JPEG uses a white background. Clipboard copy is PNG.

Guides · Transparent PNGs from SVG · SVG code to JPG · SVG code to SVG file · SVG to JPG · SVG viewer

Features

What SVG code to image can do

Input

  • Paste or upload

    Paste SVG markup, or open an .svg file up to 500 KB.

  • Formatting

    Pasted and uploaded markup is tidied with Prettier so it is easy to read and edit.

  • Code editor

    Edit the markup with syntax highlighting and line numbers. Clear starts over.

  • Scripts removed

    Scripts, event handlers and foreignObject are stripped before the SVG is drawn.

Preview

  • Live preview

    The SVG redraws as you type. Errors show next to the code.

  • Export size

    The final image size in pixels is shown before you download.

Export

  • Free sizes

    500, 1000, 1500 or 2000 px on the longest edge. The aspect ratio is kept.

  • PNG

    Keeps the transparent background.

  • JPG

    Drawn on a white background, for forms and apps that want JPG.

  • Copy PNG

    Put the PNG on the clipboard to paste into a doc or chat.

  • SVG file

    Save the markup as an .svg file.

  • Larger sizes Pro

    3000 or 4000 px, or any custom size from 100 to 8000 px.

  • WebP Pro

    A smaller file than PNG for the web, with transparency.

  • Batch to ZIP Pro

    Convert up to 50 .svg files at once into one ZIP of PNGs. File names are kept.

How to convert SVG code to an image

Three steps. The conversion runs in your browser.

  1. 01

    Paste or upload SVG code

    Paste SVG markup from your editor, design tool, or icon library, or upload an .svg file directly. The tool accepts any valid SVG code, including ones exported from Figma, Illustrator, or Inkscape.

  2. 02

    Preview your SVG image

    See an instant live preview of your SVG rendered as an image. The SVG is sanitized to remove any unsafe content, keeping the rendering safe and the output clean.

  3. 03

    Download PNG or JPEG

    Pick an output size (500 – 2000 px, longest edge), then click Download PNG or Download JPEG to save the image, or copy it straight to your clipboard to paste anywhere.

Convert an inline <svg> from HTML to an image

Copy the <svg>…</svg> element from the page HTML and paste it into the editor. Then export PNG, JPG, or an .svg file.

<svg viewBox="0 0 24 24">
    <circle cx="12" cy="12" r="10" />
  </svg>
  • Scripts and foreignObject elements are removed. use elements are removed too, whether they point at an id in the file or at another site. An image link to another site stays in the markup.
  • CSS from the source page does not come along, because only the SVG you paste is used. A style block inside that SVG is kept.
  • PNG and JPG export at 500, 1000, 1500, or 2000 px on the longest edge. The file limit is 500 KB.

Convert SVG code to PNG or JPG

PNG is the default when you need a transparent background. Download at 500–2000 px on the longest edge so icons stay sharp on a page or in a slide. JPG is smaller but always sits on white, so use PNG for logos and diagrams that have to sit on a colored background.

Why convert SVG to image?

Use SVG graphics anywhere, not just in browsers

SVG is the best format for vector graphics, but not every platform supports it. Converting your SVG code to a PNG or JPEG image lets you use it anywhere.

Social media & messaging

Twitter/X, LinkedIn, Slack, and most chat apps only accept raster images. Convert your SVG icon or diagram to PNG and share it anywhere.

Presentations & documents

Google Slides, PowerPoint, and Word handle PNG and JPEG reliably. Export your SVG illustration at high resolution for crisp results in any document.

Email templates

Most email clients do not render SVG. Convert your SVG logo or banner to PNG to make sure every subscriber sees it correctly.

Need to make your code look great too?

Paste code, pick a theme, and download a PNG with syntax highlighting. 1x needs no account.

Open Code to image

Also need to convert HTML code?

Use our free HTML code to image converter to turn any HTML markup into a PNG or JPEG, right in the browser, with no account needed.

HTML code to image converter

FAQ

Questions

Everything you need to know about the SVG code to image converter.