SVG to PNG Converter

Convert SVG to PNG right in your browser: set width and height, keep proportions, use the 2× preset for retina. Download the PNG or copy it to the clipboard.

Everything runs in your browser — your data is never sent to any server.

Why people rasterize SVG into PNG

Vector artwork scales without losing detail, but plenty of software simply refuses it: chat clients, email editors, marketplaces and office documents all expect an ordinary image file. The "svg to png" search shows up every time a logo or an icon has to be attached to a message, dropped into a slide deck, pasted into a product listing or uploaded somewhere that only accepts pictures. Converting solves one problem — turning a mathematical description of a shape into a grid of pixels that any program can open. The vector source stays available, so you can go back to it, change a colour and export again at any resolution. To look inside a file and strip the useless parts, the SVG viewer helps; rasterizing is what this page does.

What the converter does

  • Paste SVG code or drop an .svg file onto the upload zone — two ways in, one result
  • Width and height in pixels, a "from width" or "from height" mode, and a keep-proportions switch
  • Scale presets of 1×, 2×, 3×, 4× plus an original mode: a 512 × 512 SVG at 2× becomes a 1024 × 1024 PNG
  • The code is cleaned before rendering: scripts, on* handlers, external links and unsafe styles are cut out
  • Download the PNG, copy the image to the clipboard, and see the resulting file weight in kilobytes

How to convert SVG to PNG

  1. Paste the SVG code into the field or drop an .svg file into the upload zone
  2. Check the detected source size: the width and height attributes, or the viewBox when they are missing
  3. Enter a width or height in pixels, turn on keep-proportions if you need it, and pick a multiplier
  4. Press "Convert to PNG", then download the file or copy the image to the clipboard

How the rasterization works

First the code is parsed as XML and cleaned: script and foreignObject elements are removed, every attribute whose name starts with on is dropped, javascript: links and remote resources are stripped, and suspicious inline styles are cleared out. The root element then gets the target width and height, and if the source had no viewBox one is synthesized from the original size, otherwise the artwork would be cropped instead of scaled. The cleaned markup goes into a blob URL and loads into an img element, where scripts never run. The image is painted onto a canvas of the requested size and exported through toDataURL as PNG. No network request is made at any point, because every external reference was already removed.

Common SVG sizes and the PNG they produce

Source SVGMultiplierResulting PNG and where it is used
16 × 161×16 × 16 — a browser tab icon at its smallest
32 × 322×64 × 64 — favicon sized for a retina display
48 × 482×96 × 96 — macOS dock icon
180 × 1801×180 × 180 — apple-touch-icon for iOS
192 × 1921×192 × 192 — web app icon in a manifest
512 × 5121×512 × 512 — site header, chat avatar, thumbnail
512 × 5122×1024 × 1024 — logo for retina screens and print
512 × 5124×2048 × 2048 — large banner or presentation slide
1000 × 10001×1000 × 1000 — product card thumbnail
1200 × 6301×1200 × 630 — link preview image (Open Graph)
1920 × 10801×1920 × 1080 — presentation background or video cover
24 × 244×96 × 96 — a tiny UI glyph scaled up for the screen

Area grows with the square of the size: a 2048 × 2048 PNG weighs several times more than a 1024 × 1024 one, so for avatars and previews add a little headroom rather than a factor of several.

Where SVG to PNG conversion shows up every day

The most common case is a logo. A designer hands over a vector file, and it has to land in a slide deck, in an email to a client, in a product listing or in a chat message. Interface icons come next: someone asks you to send one for a pricing table, for a label in a CRM, or for a set of banners. Third is the link preview, since many platforms do render an SVG preview but still want an ordinary file when you paste a link into a chat or an email. Fourth is documents and spreadsheets, where SVG cannot be inserted but an image always can.

A worked example: preparing a logo icon as a PNG in two steps. Take the SVG file from the project assets or from the source of the site and paste its code into the converter. Look at the line showing the source size: if it reads 512 × 512, choose the 2× preset, and the output becomes a 1024 × 1024 PNG that looks equally sharp on a standard monitor and on a retina screen. Press "Convert to PNG", download the file and keep it next to the source. If the SVG had no size attributes at all, the converter suggests the size from the viewBox and the multiplier works out the second side from the proportions, so 24 × 24 becomes 48 × 48. The fill colour stays in the code, and it is worth settling it in advance with the colour picker.

There is a special case worth knowing about: artwork that arrived from somewhere else. A foreign SVG may point at an image or a font over a remote URL, and nothing will load during rendering, which leaves a blank space in the picture. The converter removes such references before rendering and lists everything it stripped, so you can check the result with your own eyes before sending it on. When the artwork has to be embedded in a page as text rather than as a file, encoding the image as Base64 is the next step.

  • Logos and icons for emails, decks and pricing tables
  • Link previews in messengers and social networks
  • Pictures inside documents, spreadsheets and reports
  • Avatars and covers where SVG is not accepted
  • Raster drafts prepared for print and large-format output
  • Preview images ready to be uploaded to a hosting account

Mistakes that cost time

The most common mistake is assuming a PNG stays sharp no matter how far you enlarge it. A raster works differently: it remembers exactly the pixels that were written. If the artwork is destined for a large screen or for print, export a version at 2× up front instead of stretching a finished file later. The second mistake is overshooting the size. The file gets heavier, the upload slows down, and the gain in on-screen quality is usually invisible.

The third mistake is forgetting about external resources. If an SVG references an image, a font or a CSS file, none of it loads during rendering, because the page makes no network requests. The icon ends up unfilled or the text switches to a system font. Such references have to be embedded into the SVG itself or the file has to be made self-contained beforehand. The fourth mistake is not looking at the preview: the converter shows the source and the finished PNG side by side, and any difference is obvious at a glance.

Finally, there is the security angle. An SVG pasted straight into a page can carry a script or an event handler. Here the code is cleaned first — script, foreignObject, on* handlers, javascript: links and remote resources are all removed — and the picture is drawn through an img element where code does not execute. That keeps outside requests from happening and leaves the page safe.

  • A raster cannot be enlarged cleanly — export with headroom instead
  • An oversized file costs bandwidth without visible benefit
  • External fonts and images inside an SVG do not load during rendering
  • Text in an SVG may change font if the font is not embedded
  • A stretched logo is the result of turning proportions off
  • Scripts and remote links from a foreign SVG are removed automatically

The conversion, step by step

Step one is parsing. The SVG is read with an XML parser and three things are pulled from the root element: the width and height attributes, the viewBox attribute and the optional xmlns declaration. When width or height is expressed in other units — points, millimetres or inches — the value is converted to pixels at the standard rate of 96 pixels per inch. If the dimensions are missing altogether, the viewBox provides them, and without a viewBox the converter proposes 512 × 512.

Step two is cleaning. Everything that should not reach a browser is taken out: script and foreignObject elements, on* attributes, javascript: URLs, remote resources and dubious styles. Step three prepares the artwork for painting by assigning the target size to the root and synthesizing a viewBox when needed, so the content scales rather than being cropped. Step four is the canvas render itself, and step five produces the PNG, ready to download or copy.

Stages of the rasterization

StageWhat happensWhat to watch for
1ParsingAn XML parser reads the root element
2Size detectionwidth, height and viewBox are read
3Size fallbackNo width and height means the viewBox is used
4Cleaningscript, on* and remote links are removed
5Preparationwidth, height and a possible viewBox are set
6RenderingThe picture is painted on a canvas of the target size
7EncodingThe canvas returns a PNG as a data URL
8DeliveryDownload the file or copy it to the clipboard

Every stage runs in the browser: the source code is never uploaded, and the PNG is assembled on your own device.

SVG, PNG and the rest: picking the right format

The choice usually comes down to one question: where will the picture live? On a site, inside an app, or in a document that will outlive the current design, use SVG — it does not depend on the screen, weighs little and stays sharp at any size. In a conversation, in an email, in a product card, in a link preview, use PNG: every program accepts it and it looks the same everywhere. Photographs and busy canvases are a different case entirely, where JPEG or WebP is the only sensible answer because PNG spends bytes wastefully on continuous tone.

WebP and AVIF deserve a line of their own: they compress better than PNG at the same quality and every current browser handles them, but not every editor and chat client does. When a file is headed for an unknown environment, PNG stays the most compatible choice. A placeholder image at the target size is a quick way to see how the frame will look. More on sizes and proportions lives in the guide to screen aspect ratios, and a finished picture can be squeezed further with the image resizer.

  • Logo and icon on a website — SVG, it never loses quality
  • Icon in a retina interface — PNG at 2×, so 48 × 48 out of 24 × 24
  • Photograph — JPEG or WebP, a raster is the only sensible format
  • Screenshot or diagram with text — PNG, it holds edges cleanly
  • Link preview — PNG at 1200 × 630, the size every platform understands
  • Cropping a finished picture is easier with a dedicated image cropper

Frequently asked questions

What is the difference between SVG and PNG

An SVG file describes shapes with math: coordinates, radii, rotations, fill rules. Its size is not fixed, so the same code can be drawn at 16 pixels or 4096 pixels without losing anything. A PNG stores a finished grid of pixels and keeps exactly the resolution it was created with; enlarging it produces blur. That is why the formats serve different purposes. SVG suits logos, icons and diagrams that live on a page, while PNG suits photographs, screenshots and anything that has to look identical in every editor. Both support transparency, but PNG only carries a single alpha channel, with no separate semi-transparent layers.

Why rasterize a vector at all

The reasons differ. Format restrictions are the most common one: an avatar uploader, an email composer or a document attachment field may only accept JPEG and PNG. Platform requirements come next, since parts of ad tooling and social networks will not display SVG at all. Workflows matter too: printing, exporting into slides, sending a file to a chat where an ordinary picture is expected. Reliability is another angle — a PNG opens the same everywhere, while SVG rendering can differ between programs, especially around fonts. The conversion is not symmetric: turning a PNG back into SVG means approximate tracing, whereas a vector becomes a raster through exact calculation.

How do I choose the right PNG size

Start from the size the picture will be displayed at and multiply by the pixel density of the screen. A standard monitor is 1×, retina panels and most phones are 2×, and some flagship models reach 3×. A practical rule: a 24 × 24 interface icon becomes 48 × 48 for retina, and a 512 × 512 logo is best shipped as 1024 × 1024. When the source defines only one side, work out the other with an aspect ratio calculator so the artwork is not stretched. Do not overshoot: the area grows with the square of the size, so a 2048 × 2048 PNG weighs several times more than a 1024 × 1024 one while the difference on screen is often invisible. Checking the fit against a placeholder image of the right size settles the question before you export.

Does converting lose quality

Not at the size you render it. The SVG is evaluated directly at the requested resolution, so edges stay crisp instead of going soft — rasterization is computation, not compression, and on screen the PNG matches the original vector. The limitation shows up elsewhere: a finished PNG cannot be enlarged without loss, because the pixels are already written down. If the artwork has to appear large, keep the SVG or export a raster version with headroom, twice the size on each side. One subtlety is text: when an SVG relies on an external font, rendering substitutes a system font, since remote resources are never loaded.

Do social networks need a PNG

Almost always, yes. Platforms accept raster formats, and many of them re-encode the upload to JPEG on their own. PNG is the most predictable choice for avatars, covers and product cards, because it keeps the edges of a logo sharp and supports transparency, which JPEG does not. Even when a platform does accept SVG, keeping a PNG version around pays off for link previews, dashboard uploads and anything pasted into a chat. Choose a size slightly larger than the target rather than several times larger, since the platform will resize the image anyway and the extra megabytes only slow the upload down.

Is it safe to paste an SVG you found online

Cleaning the code is exactly why this converter does it before rendering. Script and foreignObject elements are removed, every attribute beginning with on is dropped, javascript: URLs are stripped, and remote resources referenced over http are cut out along with unsafe inline styles. On top of that, the picture is drawn through an img element with a blob URL, where scripts cannot execute in the first place, so the page never issues outside requests. That said, stay alert: the converter shows you a picture, it does not run code, so look at the preview before sending anything on. If the original file did contain foreign code, the list of removed items tells you.

What happens when an SVG has no width or height

The converter falls back to the viewBox, which is the usual sign that a file is designed to scale. If there is no viewBox either, 512 × 512 is offered and a warning explains that the size was suggested rather than read from the file. Everything else works as usual: the suggested size becomes the base, and the 2× preset turns 24 × 24 into 48 × 48. Most icon libraries work this way, by the way — they ship a viewBox and leave the size to whoever places the icon.

Can I turn a PNG back into an SVG

That is a different job called tracing. It reconstructs outlines approximately, loses the original curves, colours and structure, and usually produces a file heavier than the one it came from. Keep the SVG source separately: it is smaller, resolution-independent and still editable. If the source is genuinely lost, a PNG can only give you a rough reconstruction, and pixel-by-pixel traced artwork is what a different family of tools is built for.

Related tools