SVG vs PNG: Vector vs Raster — Which Format to Choose
A designer sends over a logo, and the client asks: "Got a PNG?" A developer ships an icon as SVG, and marketing complains it shows up "broken" in the newsletter. One format describes a picture with formulas, the other with pixels — and that single difference decides everything: how sharp things look on Retina, how heavy your page is, and whether you can even enlarge an image without it turning to mush. Let's see who does what, and how to choose without guessing.
The short answer for the impatient
If you have a logo, an icon, a diagram or a flat illustration, go with SVG. One file will be equally crisp in the website header and on a billboard, while weighing just a few kilobytes. If you have a photo, a screenshot or a complex image with subtle color transitions, go with PNG (and for the photos themselves, JPG or WebP is often even better). SVG simply can't handle that.
Below is why that's true, and exactly where the lines fall — so you can decide for yourself instead of memorizing rules.
What the names mean
SVG stands for Scalable Vector Graphics. PNG stands for Portable Network Graphics. SVG's superpower is right there in the name — scalability.
Vector vs raster: the core idea
The whole difference boils down to one question: what's actually inside the file.
PNG is raster. The picture is stored as a grid of pixels — millions of tiny colored squares, each with its own color. Think of a mosaic: up close you see individual tiles, from a distance they form an image. The grid size is locked: a 512×512 PNG is exactly 262,144 pixels, no more, no less.
SVG is vector. There isn't a single pixel inside. Instead there's a text description of shapes written in XML: "draw a circle at point (100, 100) with radius 50 and fill it with #3B82F6," "run a curve from here to there." The browser reads these instructions and redraws the picture from scratch for the current screen size.
Every other difference grows from this fork. Raster is brilliant at capturing complex images with millions of shades — but it's tied to its resolution. Vector is weightless and infinitely scalable — but it stumbles when asked to describe a living photograph.
Scaling and Retina: the headline difference
This is the feature that wins SVG most of its fans. Stretch a 32×32 PNG icon up to a banner and you get jagged edges and blur: the browser has no new pixels to fill the gaps, so it stretches and smears the ones it has. Shrink it too far and the detail collapses into a smudge.
SVG scales with no quality loss at all. Whether it's a favicon or a building facade, the formulas are recalculated and the edges stay perfectly sharp. The same file looks great at any size.
Goodbye, @2x
On Retina and other high-density screens, raster graphics have to be prepared in several versions — standard and double size (@2x), sometimes @3x — or they look blurry. SVG is Retina-ready out of the box: it always renders at the screen's physical resolution. One file instead of three, and no fuzzy icons on new displays.
File size: when SVG is tiny, when you need PNG
This is where many people's intuition breaks, so remember one simple rule: SVG's weight depends on the complexity of the drawing, while PNG's weight depends on its size in pixels.
A simple icon or logo made of a few shapes is literally a couple of lines of text in SVG, often under 5 KB. The same logo as a PNG, prepared at 1024 pixels for a large screen, can easily run into hundreds of kilobytes. For flat graphics, SVG almost always wins by a wide margin.
But the moment an SVG accumulates lots of nodes, filters, shadows and gradients, its text description balloons — and a truly complex illustration in SVG can end up heavier than a PNG. A photo as a vector (if you could even cram it in) would simply be gigantic. Here's a rule of thumb:
Photos: why it's PNG only
The most common beginner question: "If SVG is so light and sharp, why not convert everything to it?" You can't — and here's why.
A photo has millions of pixels, and nearly every one is a slightly different shade from its neighbor: skin tones blending, a soft-focus background, gentle shadows, highlights. Describing that with shapes is impossible — you'd need millions of microscopic regions. The file would be huge, the browser would choke while rendering it, and the result would still look worse than the original. A photograph is raster by nature.
PNG, on the other hand, handles millions of shades effortlessly: PNG-24 carries around 16 million colors plus an alpha transparency channel, and it does so losslessly — pixels aren't coarsened when you save. The price is weight: for pure photos, WebP or JPG usually deliver the same look at a far smaller size. PNG comes into its own where you need precision and transparency together: UI screenshots, images with crisp text, graphics that sit over any background.
Both have transparency — but of a different kind
Both SVG and PNG support transparency, including smooth transparency (semi-transparent pixels, soft edges). So the choice between them isn't decided by whether you need transparency — it's decided by the nature of the image: shapes, or photo pixels.
Animation, styling and text sharpness
There's a zone where SVG isn't just more convenient — it does things PNG fundamentally can't.
- Animation and interactivity. SVG is code right inside the HTML page, so you can animate it with CSS or JavaScript: smoothly shift color on hover, draw a line on the fly, rotate elements. PNG is static (the moving variant is a separate format, APNG).
- On-the-fly styling. An SVG icon's color can be changed with a single line of CSS — for example, recolored for dark mode. A PNG would have to be redrawn and re-exported.
- Perfectly sharp text and lines. A logo with thin lettering stays crisp at any zoom in SVG. The same text in a PNG at a small size is bound to "blur."
That's exactly why UI icons, logos and infographics on modern sites are almost always built in SVG.
Which to pick for the job
Let's put it all in one table — the fastest way to decide.
| Criterion | SVG (vector) | PNG (raster) |
|---|---|---|
| Type | Shapes defined by formulas | Grid of pixels |
| Scaling | Infinite, lossless | Blurs when enlarged |
| Retina-ready | Out of the box, no @2x | Needs @2x/@3x versions |
| Logos and icons | Perfect, tiny weight | Heavier, doesn't scale |
| Photos and screenshots | Not suitable | Native habitat |
| Transparency | Yes | Yes (alpha) |
| Animation and CSS styling | Yes | No (APNG only) |
| Editable as code | Yes, it's text | No, editor only |
| Universal support | Sometimes not accepted | Opens everywhere |
The practical takeaway is simple: don't pick "one format for everything." On a well-built site the logo and icons are SVG, screenshots and graphics with transparency are PNG, and photos are JPG or WebP. Each image in its own format means both top quality and the smallest page weight.
How to convert in both directions
The formats aren't enemies — they're easy to translate into each other, as long as you understand what's happening.
SVG → PNG (rasterization). A simple, exact conversion: the vector is "rendered" into a pixel grid of the chosen size. You do this when a platform won't accept SVG — social networks, marketplaces, email campaigns, slide decks. Pick the size (or DPI) you want and you get a crisp PNG.
PNG → SVG (tracing). This one is trickier: software outlines the raster's edges with curves and tries to "guess" the shapes. For simple flat graphics — a single-color logo, a silhouette — it works decently. For a photo or a complex drawing, the result is approximate and usually worse than the source. Tracing is a tool for recovering simple graphics, not a magic "make any picture vector" button.
Identify the image's nature
Shapes and solid colors point to SVG. Photo pixels point to PNG.
Drop the file into a converter
Drag it into your browser — nothing to install.
Grab the result
SVG → PNG at any size, or try PNG → SVG tracing for simple graphics.
Turn SVG into PNG in seconds
The free FormatZ converter rasterizes a vector into a crisp PNG at the size you need — right in your browser, with no install and no sign-up. Need the other way around? That's here too.
Convert SVG to PNGNeed the reverse conversion for simple graphics? Use the PNG to SVG converter. For photos, take a look at SVG and WebP, and the full list of every conversion is always on the all formats page.

