An SVG file (Scalable Vector Graphics) is a vector image stored as XML text: instead of pixels it holds instructions such as draw a curve from here to there, fill this region with that color, set this string in that typeface. Because the browser executes those instructions every time it renders, the artwork stays crisp at any size and a simple icon is often only a couple of kilobytes. The rule of thumb: keep logos, icons and charts as SVG, and convert to PNG, or to JPG when transparency is not needed, for social media, email, office documents and any dashboard that refuses vectors.
This article covers where vectors win, where they get in the way, which settings decide the result when you rasterize, and why some files are rejected outright.
When rasterizing is the right call, SVG to PNG gives a lossless result that keeps transparency, SVG to WebP gives a smaller file, and SVG to JPG maximises compatibility. For the smallest possible export try SVG to AVIF, and use the image resizer if the output dimensions need adjusting afterwards. Conversion happens on the server and the file is not stored.
What an SVG file is, and where it diverges from raster art
A raster image is a grid of colored dots. Blow a 400-pixel PNG up to 1200 pixels and the browser has no extra information to work with; it invents intermediate dots by guessing, and the result goes soft. Scaling a vector drawing simply applies the same mathematical description to a larger canvas, so nothing is lost.
The second difference is editability. A vector drawing opens in a plain text editor, and colors, stroke widths, even whole layers can be changed by hand. The shortest version of an SVG embedded in a page looks like this: <svg viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="#2a9d8f"/></svg>. That single line draws a green circle, and editing the fill value recolours it. When a brand palette shifts, that turns a week of redrawing icons into a single find-and-replace.
How to open and view an SVG
The most reliable viewer is a browser: drag the file into an empty tab and it renders. For editing, use a vector drawing program or a plain text editor. Some image viewers, office suites and corporate dashboards either refuse SVG or render it incompletely, and most cases where a file “looks broken” turn out to be a limitation of the program opening it.
What determines the weight of the file
A vector drawing weighs what its node count says it weighs, not what its on-screen size suggests. A clean icon can land under a kilobyte. A drawing produced by auto-tracing software, carrying tens of thousands of nodes, can run into megabytes and make the browser work hard to paint it. Complexity, not dimensions, is the thing to watch.
A quick test settles it: save the drawing both as a vector and as a raster at the size you will actually use, then compare the two files. If the raster is clearly smaller, the artwork is too complex to be worth keeping as a vector.
Where vectors genuinely win
- Logos and brand marks. One file serves the business card, the signage and the favicon.
- Interface icons. High-density displays stop requiring a second and third exported set.
- Charts and diagrams. Text stays real text, which screen readers and search engines can actually read.
- Artwork that needs color variants. A dark-theme version is a changed attribute, not a new asset.
Photographs, natural textures and illustrations with thousands of blended colors do not belong in a vector. Automatic tracing from raster to vector is deliberately not offered anywhere in the toolset: the output either drifts far from the original or ends up heavier than the picture it replaced.
Animation and interactivity
A less obvious advantage is that every part of a vector drawing can be addressed individually. Highlighting one bar in a chart, marking one region on a map or rotating just the arrow of an icon needs no extra files. That flexibility has a cost: a drawing with many moving parts is expensive to paint on low-powered phones. If scrolling stutters, reduce the motion or rasterize that part. Bear in mind that rasterizing turns any animation into a single still frame.
When an SVG file should become a PNG
Vectors look unbeatable on paper, yet several everyday situations call for rasterizing.
- The destination refuses vectors. Social sharing images, email templates and most marketplace back-ends accept raster uploads only.
- The artwork goes into a document. Office suites and print workflows behave far more predictably with a fixed-resolution file.
- There is a font dependency. A drawing whose text has not been converted to outlines renders differently on a machine without that typeface. Rasterizing freezes the appearance.
- The drawing is enormously complex. Painting tens of thousands of nodes on every visit costs more than shipping one raster export.
If none of those apply, stay in vector. Rasterizing is a one-way door, so keep the source file regardless of what you publish.
Comparison table: which format to convert an SVG to
| Target | Transparency | Output quality | Choose it when |
| PNG | Kept | Lossless | Logos, icons, hard-edged graphics |
| WebP | Kept | 90 | A smaller file for the web |
| AVIF | Kept | 60 | The smallest file, modern browsers |
| JPG | Flattened to white | 90 | No transparency needed, must open anywhere |
| GIF | One-bit, jagged edges | 256 colors at most | Legacy systems that demand GIF |
| BMP | Flattened to white | 24-bit, uncompressed | Old software that only reads BMP |
Most of the time the decision is PNG versus WebP: PNG when the file is going to someone else or into a dashboard, WebP when it goes on your own site. The last two rows, SVG to GIF and SVG to BMP, only make sense for older software that accepts nothing else.
Rasterizing settings: dimensions, density and background
Three things determine what comes out the other side.
Output dimensions
The converter renders the drawing at 144 DPI, and the pixel size of the result follows from the width and height declared inside the SVG at that density. In other words, you do not type a target size. If an edge of the result would exceed 4000 pixels, the image is scaled down to 4000 with its aspect ratio intact. When you need an exact size there are two routes: change the width and height values in a text editor before converting, or adjust the output in the resizer afterwards. Shrinking afterwards is harmless; enlarging afterwards means scaling up pixels and costs sharpness, so if you need a big export, make it big inside the SVG.
Background handling
A transparent drawing keeps its transparency in PNG, WebP and AVIF. JPG and BMP have no alpha channel, so the empty area is flattened to white; GIF only knows one-bit transparency, so soft edges can turn jagged. That is why converting a logo meant for dark backgrounds to JPG is a poor idea.
Fonts and embedded pictures
If text in the drawing refers to a typeface the server does not have, the letters are drawn with a substitute. Converting text to outlines before export removes that risk entirely. If the drawing contains a photo or texture, that picture has to be embedded inside the file; drawings that link to an outside file or address are rejected for the reason explained next.
Which SVG files the converter rejects
An SVG is not only a drawing but also an XML document, and it can carry executable code or references to other resources. For security reasons the converter refuses files containing any of the following:
- Scripts.
script blocks and event attributes such as onclick.
- External resource calls. Links to an outside picture, typeface or stylesheet.
- XML entity declarations.
ENTITY definitions at the top of the document.
Most exports from design tools pass without trouble. When one does not, the fix is usually quick: re-export with linked images embedded, convert text to outlines, and delete unused scripts and declarations. SVG is never offered as an output format; the tools only produce raster images.
Practical notes for shipping vectors on a page
There are two ways to put a drawing on a page and they behave differently. Referencing the file from an ordinary image tag is the simple route: the browser caches it, the markup stays clean, and you cannot reach inside the artwork afterwards. Inlining the drawing into the page markup lets stylesheet rules drive its colors, which is how a single rule can recolour every icon for a dark theme. The cost is that using the same icon in ten places repeats the markup ten times and gives up the caching benefit.
On accessibility, two small habits are enough. Give a meaningful drawing a short title so a screen reader can announce what it is, and explicitly hide a purely decorative one so the reader does not try to describe an empty graphic.
A final caution: exports from design tools arrive stuffed with editor metadata, hidden layers and absurd decimal precision. Cleaning that out before publishing often halves the file; an untouched icon can weigh tens of kilobytes where a clean one weighs a few.
Frequently asked questions
Can I convert a PNG back into a vector?
Not as an automatic step. Deriving vectors from pixels means inventing information that was never there, and the result is either a rough imitation or a file with thousands of nodes that weighs more than the original. The right move is to go back to the source drawing or redraw the mark.
Are vector files safe to accept from third parties?
The format can carry scripts and external references, so drawings from unknown sources should not be embedded directly into a page. Rasterizing eliminates that concern, because the export contains nothing but pixels, and it is also why the converter turns away files with scripts or outside links.
Which format should a favicon use?
Modern browsers accept vector favicons, but older clients and operating-system shortcuts still expect raster. The pragmatic answer is both: keep the vector as the source of truth and generate 32, 96 and 180-pixel PNG copies alongside it. The favicon generator makes those copies in one go, and the PNG to ICO converter builds the .ico file older browsers look for.
Why is my converted PNG smaller than I expected?
The output size comes from the dimensions declared in the SVG. If the design tool exported the drawing at, say, 48 × 48, the result will be small too. Open the SVG in a text editor, raise those values and convert again; because it is a vector, nothing gets blurrier.
Still unsure which export target to settle on? How to choose an image format puts the options in one table, and image optimization for SEO covers the file naming and alt text side once the export exists. If you are torn between the two classic raster formats, read PNG vs JPG, and for the logic behind stripping excess markup from SVG code, see what is minification.