SVG to PNG Converter at 2x, 4x or Custom Width
Rasterise SVG to PNG, JPG or WebP at any resolution in your browser
Drop an .svg file or click to upload — or paste the code below
Source size: 24 × 24px (from viewBox)
Output: 96 × 96px
The preview appears here.
How this SVG to PNG converter sizes the output
An SVG is a set of drawing instructions, not pixels, so converting it to PNG means choosing a resolution and letting the browser draw the vector at that size. This tool reads the root <svg> element to work out the image's natural size. If it has both width and height, those are used (units such as pt, mm, cm and in are converted to CSS pixels at 96 per inch). If one of them is missing, the other is derived from the viewBox aspect ratio. If both are missing, which is common for icons exported from design tools, the viewBox width and height become the base size. Only when there is no size information at all does it fall back to the browser default of 300 by 150.
From that base you pick 1x, 2x or 4x, or type a custom output width and the height follows the aspect ratio. Before rendering, the tool rewrites the root element's width and height to the exact output pixel size, and adds a viewBox if the file lacked one. That matters: the vector is rasterised at the final resolution rather than drawn small and stretched, so edges stay crisp. This is how you convert SVG to PNG at high resolution for print, retina screens, app store assets or slide decks. Very large requests are reduced to stay within what browsers allow for a single canvas (16,384 pixels per side and about 16.7 megapixels in Safari), and the tool tells you when that happens.
A practical rule for picking the multiplier: 1x matches how the SVG was designed, 2x suits retina screens and most web or slide use, and 4x or a custom width of 2000 pixels and up is the safe choice for print, README banners and store listings. The download is named with its final pixel dimensions, so exports at several sizes stay easy to tell apart.
PNG, JPG or WebP, and what about backgrounds?
PNG is the usual choice: lossless, with full transparency, so an icon or logo keeps its see-through background. Leave Transparent ticked for that, or untick it and pick a colour to flatten the image onto a solid background. SVG to JPG always needs a background, because JPEG has no alpha channel; the colour picker defaults to white so transparent areas do not turn black. JPG is smaller for illustrations with gradients but adds compression artifacts around sharp lines. SVG to WebP keeps transparency like PNG and is usually much smaller, which suits images going onto your own website. JPG and WebP get a quality slider; PNG does not need one.
The conversion happens entirely in your browser. The SVG markup is turned into a Blob, loaded as an image, drawn onto a canvas and exported with canvas.toBlob. Nothing is uploaded. Loading an SVG as an image also means scripts inside it do not run and external resources (linked bitmaps, web fonts, remote stylesheets) are not fetched, which is safe but has a consequence: text set in a font that is not installed on your machine falls back to a default font. Convert text to outlines in your editor first if exact typography matters. If you only need the vector smaller, the SVG Optimizer is the better tool; if the target is a React component, use SVG to JSX instead of rasterising.
How to use the SVG to PNG Converter at 2x, 4x or Custom Width tool
- 1
Paste or upload your SVG
Paste SVG code into the editor or drop an .svg file. The detected source size and where it came from (attributes or viewBox) are shown underneath.
- 2
Choose the output size
Pick 1x, 2x or 4x of the source size, or switch to Custom width and type the pixel width you need; the height keeps the aspect ratio.
- 3
Pick a format and background
Choose PNG, JPG or WebP. Keep the background transparent for PNG and WebP, or pick a solid colour (required for JPG).
- 4
Check the preview and download
The checkerboard preview updates as you change settings. Download the file, named with its final dimensions.
Frequently asked questions
How do I convert SVG to PNG in high resolution?
Choose 4x, or Custom width with the pixel width you need (for example 2048). The tool sets the SVG's width and height to that size before drawing, so the vector is rendered at full resolution rather than upscaled from a small bitmap.
Does the PNG keep a transparent background?
Yes, as long as Transparent is ticked and the format is PNG or WebP. Any area the SVG does not paint stays fully transparent. JPG cannot store transparency, so a background colour is always applied for JPG output.
My SVG has no width or height. Will it still work?
Yes. The viewBox is used as the base size, and the tool injects explicit width and height attributes before rendering, which also avoids browsers that refuse to draw size-less SVGs onto a canvas.
Why does the text in my PNG use the wrong font?
An SVG loaded as an image cannot fetch web fonts or other external files, so text falls back to fonts installed on your system. Convert text to paths (outlines) in your design tool before exporting the SVG.
Is it safe to paste an SVG from an unknown source?
The SVG is rendered as an image, and browsers do not execute scripts or load external resources in SVGs used that way. The file is also processed only in your browser, never uploaded.
Related on TechLogHub
Related Image Tools
Image to Base64
Convert images to Base64-encoded data URIs
Base64 to Image
Convert Base64 strings back to downloadable images
Image Resizer with Locked Aspect Ratio
Resize images client-side with custom dimensions
Image Cropper
Crop images with a visual selection tool
PNG to WebP & WebP to JPG Image Converter
Convert images between PNG, WebP, and JPEG formats
Image Compressor to 100KB, 50KB or Any Size
Compress images to a target file size or quality, in batches, in your browser
Get the next tool before you need it
One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.

