Free images tool

Rasterize an SVG into a transparent PNG at the size the file declares

For designers and developers who need a PNG of a logo, icon or chart for a document, a slide or a tool that cannot read SVG. Your browser renders the vector file and exports the pixels; nothing is uploaded and no script inside the SVG is executed.

Transparent background keptSize taken from the SVG's width and heightRendered by your own browser, no upload
SVG to PNG

Choose an SVG, then convert; the PNG preview and its download button appear below.

Runs on your device
Choose a file or drop it hereSVG file, converted to PNG

What the SVG to PNG does

An SVG is a set of drawing instructions, not pixels. To use it where only bitmaps are accepted, something has to render it at a fixed size. This converter uses your browser's own SVG engine: it loads the .svg as an image, reads the intrinsic width and height, draws it on a transparent canvas of that size and exports a PNG with the same base file name.

The size is the detail to get right before you start. There is no scale or dimension field in this tool. A root element with width="512" height="512" produces a 512 by 512 PNG; physical units are converted to CSS pixels; an SVG with only a viewBox, or with percentage sizes, falls back to the browser's default image size, which in our Chrome test was a 300 by 150 pixel box.

Choose it for self-contained SVG files: paths, shapes, text in common fonts, gradients, filters and inline styles all render. Files that depend on external images, web fonts or embedded HTML are less predictable, and the sections below explain exactly what happens with each.

How to use it

Choose an SVG file

Select one .svg file. Open it in a text editor first if you are unsure of its size: the width and height attributes on the root svg element decide the PNG dimensions.

Convert to PNG

Press Convert to PNG. The browser renders the SVG as an image, clears a canvas of the intrinsic size to transparent, draws the rendering onto it and encodes a PNG.

Check dimensions and edges

The status line reports the pixel size and file sizes, and the preview sits on a checkerboard so transparent areas show at once. Press Download to save the PNG and check curves for sharpness at full size; if it is too small, edit the SVG's width and height and convert again.

How the PNG size is decided

The converter reads the image's naturalWidth and naturalHeight, the intrinsic size MDN documents for image elements, and makes the canvas exactly that big. What the browser reports depends on how the SVG declares its size. We tested five variants in a current Chrome build on this page and got these results:

To get a larger or exact PNG, open the SVG in a text editor and set width and height on the root element to the pixel size you want, keeping the viewBox so the drawing scales to fill it. Other browsers can report different defaults, so always check the status line. An SVG declaring more than 80 megapixels, for instance 10000 by 10000, is refused with a message rather than rendered.

  • width="200" height="100" with no units: a 200 by 100 pixel PNG, as written.
  • width="10cm" height="5cm": 378 by 189 pixels, because browsers map physical units to CSS pixels at 96 per inch.
  • A viewBox but no width or height: 300 by 150 pixels, the browser's default size for an image with no intrinsic dimensions.
  • width="100%" height="100%" with a square viewBox: 150 by 150 pixels, the default box constrained to the aspect ratio.
  • No viewBox, width or height at all: 300 by 150 pixels, and anything drawn outside that box is cut off.

What a browser will and will not render inside an SVG image

When an SVG is used as an image rather than as a document, browsers apply security restrictions that MDN lists: scripts do not run, external resources such as images and stylesheets may be refused unless they are inlined as data: URLs, and visited-link styles are ignored. Any script element in your file is simply ignored here, which is also why the conversion is safe to run on files from unknown sources.

External references are the gray area. In our Chrome test an image element pointing at a PNG on another website did load and appeared in the output; MDN describes this as something browsers may block, so other browsers can leave a blank space where that image was. Embedding the bitmap as a data: URL inside the SVG removes the uncertainty.

Text renders with fonts installed on your computer or embedded in the SVG as data: URLs. A font referenced by URL from a font service may not load, and a font you do not have falls back to a substitute, so convert on a machine that has the fonts, or outline the text in your vector editor first.

One construction fails outright. An SVG containing a foreignObject element, which some exporters use to embed HTML, taints the canvas in Chrome: the browser treats it as cross-origin content and refuses to export it. The tool then shows the error Chrome raises, "Tainted canvases may not be exported", and you need to flatten or remove that element before converting.

Transparency, styling and what ends up in the PNG

The canvas is cleared to fully transparent before drawing, so any area the SVG does not paint stays transparent in the PNG, with 8-bit alpha for soft edges and semi-transparent fills. If you need a solid background, add a rectangle as the first element of the SVG.

Inline style blocks, presentation attributes, gradients, patterns, masks, clip paths and SVG filters are rendered by the browser engine, so the PNG matches what that browser shows when it opens the file. Anti-aliasing and filter precision differ slightly between browsers, which is why two people converting the same file can get PNGs that differ by a few pixels.

SMIL and CSS animations are captured as a single frame. Metadata, editor-specific namespaces and the SVG source itself are not included; the PNG holds pixels only.

Limits to know before you rely on it

  • No size or scale control: the PNG is exactly the SVG's intrinsic width and height, so edit the file to change it.
  • SVGs with only a viewBox or percentage sizes fall back to the browser's default image size, 300 by 150 pixels in Chrome.
  • Files containing a foreignObject element fail with a tainted-canvas error in Chrome.
  • External images and web fonts referenced by URL may not load, depending on the browser; inline them as data: URLs.
  • Scripts inside the SVG never run, and animations are captured as one still frame.
  • Sizes above 80 megapixels are refused, and rendering quality varies slightly between browser engines.

Questions people ask about the SVG to PNG

How do I get a bigger PNG than the SVG's default size?

Open the SVG in a text editor and set explicit width and height attributes in pixels on the root svg element, for example width="2048" height="2048", while keeping the viewBox. The browser scales the drawing to that size and the PNG comes out at those dimensions. Alternatively convert at the default size and enlarge the PNG with the Image Resizer, accepting some softness.

Why is my PNG 300 by 150 pixels?

Your SVG has no absolute width and height, so the browser used its default size for an image without intrinsic dimensions. Add width and height attributes to the root element, matching the viewBox's proportions, and convert again.

What does "Tainted canvases may not be exported" mean?

The SVG contains content the browser classifies as cross-origin, almost always a foreignObject element with embedded HTML. Chrome marks the canvas as tainted and blocks the export, as MDN's page on cross-origin images describes. Remove or flatten the foreignObject in your vector editor and try again.

Will the background be transparent?

Yes, wherever the SVG does not paint. The canvas starts fully transparent and PNG keeps alpha, so logos and icons come out with clean transparent surroundings. If your SVG has a background rectangle, that rectangle is rendered like any other shape.

Why do the fonts look different in the PNG?

Text is rendered with fonts available to your browser. If the SVG names a font you do not have installed, or loads one from a web address the image context blocks, a fallback font is used. Install the font, embed it as a data: URL, or convert text to paths before exporting the SVG.

Is the SVG uploaded or executed anywhere?

No. The file is loaded as an image in your browser through a temporary local URL, which disables any scripts it contains, rendered on your device and exported as PNG with the canvas API. The site receives nothing.

Sources and further reading