Design

PNG for Web and Design: When to Use It (and When SVG or WebP Wins)

PNG is the format many people pick on autopilot: "need transparency? must be PNG." Sometimes that's exactly right. Other times it's how a one-megabyte image ends up on a page when it could have been twenty times lighter. Let's cut the fluff and figure out where PNG is genuinely irreplaceable — and where it's quietly dragging your page down.

A portfolio website on screen — the everyday scene where PNG, SVG and WebP all meet
A single web page usually mixes several formats — and each one has its own right job to do. Photo: Pexels

Where PNG genuinely shines

To know when to reach for PNG, remember its two superpowers: lossless compression and a true alpha channel (per-pixel transparency). "Lossless" means that after saving, the image is pixel-for-pixel identical to what you had in the editor — none of the artifacts around sharp edges that JPG is notorious for.

Those two traits lead to a handful of scenarios where PNG is almost unbeatable:

  • Interface screenshots. Sharp lines, small text, high-contrast buttons — PNG keeps all of it perfect. JPG smears the letters and leaves "dirt" around the borders on the same shot.
  • Graphics with text and crisp edges. Infographics, diagrams, banners with captions, memes — anywhere edge sharpness matters.
  • Images with complex transparency. Soft shadows, glows, blurred edges, semi-transparent gradients — PNG-32 stores 256 levels of transparency per pixel, and that's its signature act.
  • Raster logos and icons — when there's no vector source and the image has to sit on any background.

The whole rule in one line

Choose PNG when precision matters more than weight: sharp text, crisp edges, complex transparency. But when the image is full of smooth photographic gradients, PNG almost always loses on file size.

What PNG handles poorly is ordinary photographs. Lossless compression can't throw away tiny, invisible details, so a photo in PNG weighs several times more than the same photo as JPG or WebP at the same perceived quality. For photo content there's nearly always a better format.

PNG vs SVG: raster vs vector

This is the first fork in the road, and the one people get wrong most often. The difference is fundamental: PNG is raster (a fixed grid of pixels), SVG is vector (a mathematical description of lines and shapes). A vector can be scaled from a postage stamp to the side of a building without a single blurry pixel.

Here's what that means in practice for logos, icons and interface elements:

CriterionPNG (raster)SVG (vector)
ScalingBlurs when enlargedCrisp at any size
Weight of a simple icon/logoKilobytes to tens of KBOften smaller than PNG
Retina readinessNeeds @2x/@3x exportsOut of the box
Animation and CSS stylingNoYes
Photos, complex texturesWorksDoesn't work

The takeaway is simple: for logos, icons, pictograms and UI elements on the web, default to SVG. It's lighter, always sharp, and you can recolor and animate it right in CSS. PNG is justified here only as a fallback for truly ancient systems — or when a logo has a raster effect (photographic texture, complex gradient noise) that a vector can't reproduce.

A designer sketching an interface wireframe on a whiteboard — where the PNG-vs-vector call gets made
The "PNG or vector" decision is made at the layout stage, not at export time. Photo: Pexels
SVG asks "what shape is the object?", PNG asks "what color is every pixel?". For a logo, the first question is almost always the right one.

PNG vs WebP and AVIF on the web

Say the image truly has to be raster — a screenshot, or an illustration with transparency. Does that mean you need PNG? In the modern web, not necessarily. PNG now has direct heirs that do the same job for less weight.

  • WebP supports both lossless compression and transparency — exactly like PNG — but the file comes out noticeably smaller. Browser support sits around 95% of users.
  • AVIF compresses even harder (roughly 50% smaller than JPG and 20–30% smaller than WebP at comparable quality), also handles transparency, and offers deeper color. Support is around 94%.

An everyday tip

Got an image with transparency for the web? Try WebP first: same transparency, same sharpness, less weight. Keep PNG as a fallback via <picture> for the rare browsers that don't understand WebP.

So when is PNG still the better pick over WebP or AVIF? Three cases:

  • You need 100% compatibility with no fallback hassle — for example, an image in an email newsletter, where mail clients are finicky.
  • The file is already tiny — a 1–2 KB icon, where half a kilobyte of savings isn't worth the extra complexity.
  • A tool or platform won't accept WebP — an old CMS, a specific uploader, a client requirement.

In every other case, "modern format + PNG/JPG as a fallback" wins on the web. The good news: you don't have to convert anything by hand — a PNG to WebP converter does it in seconds.

Retina and @2x exports: no more blur

The main trap with any raster, PNG included, is high-density screens (Retina and its kin). On such a display, one "logical" CSS pixel is built from two or even three physical ones. Drop an icon in at exactly its display size and the browser will stretch it — and it'll go soft, the dreaded blur.

The fix for raster is to export it larger:

@1x
standard screens (1 physical pixel per CSS pixel)
@2x
×2 — most Retina and phones
@3x
×3 — top-tier phones (3 physical pixels)
srcset
attribute that serves the right one
24px icon
export 48px (@2x) and 72px (@3x)
Alternative
SVG — crisp with no @2x at all

In practice this means: an icon shown as 24×24 on the site has to be exported as PNG at 48×48 and 72×72 too, then listed in srcset so the browser can pick the right one for the screen. It sounds like extra work, and it is — which is exactly why SVG is so convenient for icons and logos: retina simply doesn't apply to it, one file serves every screen at once.

A common mistake

Don't confuse "export @2x" with "drop in a huge image and shrink it with CSS." In the second case the user downloads a giant file they don't need on a standard screen — and that hurts speed. File size should match screen density, not be padded "just in case."

Impact on load speed and optimization

This is the part that makes all the rest worth knowing. Images are the heaviest piece of a typical page: per the 2025 Web Almanac, images account for around 48% of a median page's total weight. And it's usually an image that turns out to be the large element defining the "page has loaded" moment in Google's eyes — that's the case for about 76% of pages on mobile and 85% on desktop.

≈48%of page weight is images
50–70%savings from optimizing PNG
76%of mobile pages: LCP is an image

The conclusion: a heavy PNG isn't "just a bigger file," it's a slow site and a search-ranking hit. The good news is that PNG can nearly always be slimmed down with no visible quality loss. Here's a working order of operations, from gentle to drastic:

1

Cut the palette

If the image has few colors (an icon, a logo, simple graphics), save it as PNG-8 — an indexed palette of up to 256 colors. Often 64 or even 32 colors are indistinguishable from the full palette, while the file gets several times lighter.

2

Run it through an optimizer

Tools like TinyPNG, pngquant, OptiPNG or ImageOptim smartly trim the palette and strip extra metadata. A 50–70% size cut with no visible difference is routine.

3

Serve a modern format

If the PNG is still heavy after optimizing (especially with photographic areas in it), convert to WebP or AVIF. Same frame, same transparency, one and a half to two times lighter.

A designer sketching app icons by hand — icons on the web are almost always better kept as vectors
An icon set is a classic candidate for an SVG sprite or optimized PNG-8 rather than heavy PNG-24 files. Photo: Pexels

Practical tips for designers

Let's gather the scattered rules into a short working checklist — the things worth keeping in mind right at the moment of exporting from Figma, Photoshop or Illustrator:

  • A logo, icon or simple pictogram? → SVG. PNG only as a fallback.
  • A screenshot or graphic with text? → PNG (or lossless WebP for the web).
  • A photo with no transparency? → JPG/WebP/AVIF, not PNG.
  • A photo with transparency or soft shadows? → WebP/AVIF, PNG-32 as a backup.
  • Making raster for the web? → don't forget @2x for retina and srcset.
  • Any PNG before upload → run it through an optimizer. Always. It's free kilobytes of speed.
  • Specify width and height in the markup — it kills layout "jumps" during load and improves stability metrics.

A mini-trick for UI

If you have dozens of small PNG icons, combine them into one sprite (a single image positioned with CSS) or, better still, an SVG sprite. That turns dozens of server requests into one and noticeably speeds up how the interface loads.

How to convert PNG (and back)

The most common practical step is turning a finished PNG into a lighter web format. It happens in the browser in seconds, with nothing to install:

Lighten your PNG right now

The FormatZ converter turns PNG into WebP while keeping transparency — the same image, noticeably less weight. Free, right in your browser, no signup.

Convert PNG to WebP

Other handy directions for specific tasks:

  • PNG → JPG — for photos with no transparency, where minimum weight is the goal.
  • PNG → SVG — tracing simple graphics and logos into vector.
  • WebP → PNG — back to PNG when a tool won't accept WebP.

The full list of conversions is always on the all formats page. And if you want to dig deeper into PNG itself, see "What Is PNG" and "Transparency in PNG".

If the logo is vector (and almost every modern logo is), use SVG: it weighs next to nothing and stays perfectly crisp at any size on any screen. Reach for PNG only as a fallback for older systems, or when the logo has a raster effect — a photographic texture or complex grain — that a vector simply cannot reproduce.
When you need rock-solid compatibility with no fallbacks, when the image is tiny (a two-kilobyte icon where the size difference is invisible), or when a tool or platform simply cannot handle WebP. In every other case, WebP or AVIF give you the same picture at a smaller weight and also support transparency.
On high-density displays (Retina and similar) one CSS pixel is made of two or three physical pixels. To keep a raster image from looking blurry, you export it larger: @2x is twice the size, @3x is three times. The right variant is then served through the srcset attribute.
PNG compresses losslessly, so photos and complex images weigh far more than they would as JPG or WebP. There are three fixes: shrink the palette (use PNG-8 instead of PNG-24 when colors are few), run the file through an optimizer like TinyPNG or pngquant (often 50–70% lighter), or simply serve the image as WebP/AVIF.
Yes — PNG is almost the ideal format for screenshots: lossless compression keeps sharp edges, small text and lines artifact-free. JPG smears letters and leaves dirt around high-contrast borders on the same shot. If a screenshot is heavy, optimize it or convert to WebP, which is also lossless and lighter.