The Ultimate Guide to Image Formats (PNG, JPG, WEBP, SVG)
Every image format explained — when to use each, how they compress, transparency, animation, browser support, and the modern defaults you should ship.
The four formats you actually need
There are dozens of image formats. Four of them cover 99% of web use:
- PNG — lossless, transparent, sharp text.
- JPG — lossy, photographic, tiny.
- WEBP — modern, smaller, supports everything.
- SVG — vector, infinitely scalable, tiny for line art.
A fifth — AVIF — is the rising challenger. We'll cover it briefly at the end.
PNG: the lossless workhorse
PNG uses deflate compression (same family as gzip) with per-row predictive filters. Every pixel is preserved exactly.
When to use PNG:
- Logos, icons, illustrations with flat colors.
- Screenshots with text — text stays crisp, no artifacts.
- Anything requiring transparency (PNG supports 8-bit alpha).
- Master/source files you'll re-edit.
When not to:
- Photos. A 12 MP photo as PNG can be 20+ MB.
- Anything where file size matters more than pixel-perfect fidelity.
PNG has three sub-modes: 8-bit palette (tiny for icons), 24-bit RGB, and 32-bit RGBA (with alpha). Pick the smallest mode that fits your content.
JPG: the photo king
JPG uses lossy compression based on the discrete cosine transform. It's the format your phone uses, your camera uses, and 80% of the photos on the web.
When to use JPG:
- Photos and photo-realistic renders.
- Gradients and natural textures.
- Anywhere you need small files and can accept minor quality loss.
When not to:
- Logos and line art — sharp edges develop visible artifacts.
- Anything needing transparency — JPG has none.
- Images you'll re-edit repeatedly — each save loses quality.
Pro tip: pick a quality in the 70–85 range. Below 70 you'll see artifacts; above 85 the file size balloons for invisible gains.
WEBP: the modern default
WEBP, from Google, supports both lossy and lossless modes, alpha transparency, and animation. It's 25–35% smaller than JPG at equivalent quality and 25% smaller than PNG for lossless.
When to use WEBP:
- Anywhere on the modern web. Seriously.
- As a one-format replacement for both JPG and PNG.
When not to:
- Legacy CMS pipelines that reject it (increasingly rare).
- Source/master files — keep PNG or PSD.
- When you need maximum tooling compatibility (some image processors still choke).
Browser support has been universal since 2020 (Safari caught up in 2020, every other browser years earlier). For new projects, ship WEBP.
SVG: the vector format
SVG isn't a raster format — it's a vector format, describing shapes as XML paths. It scales infinitely without quality loss, and the files are typically tiny for line art, icons and illustrations.
When to use SVG:
- Logos and brand marks.
- Icons (Lucide, Heroicons, etc. all ship as SVG).
- Illustrations with simple shapes.
- Anything that needs to scale from favicon to billboard.
When not to:
- Photos — SVG can't encode photographic detail efficiently.
- Complex illustrations with thousands of paths — rasterize to WEBP.
SVG supports CSS styling, animation, and interactivity. It's the format behind modern icon systems.
AVIF: the challenger
AVIF is the AV1-based image format. It's 20–30% smaller than WEBP at equivalent quality. The trade-offs:
- Slower to encode (sometimes 5–10× slower than WEBP).
- Less universal tooling support.
- Some decoders struggle with certain AVIF subsets.
Use AVIF when you have a build pipeline that can pre-encode (Next.js Image, sharp, Cloudinary) and you want the absolute smallest files. For interactive browser tools, WEBP is still the practical choice.
The decision tree
- Is it a photo? → WEBP (lossy) for the web, JPG for legacy compatibility.
- Is it a logo or icon? → SVG if vector, PNG if raster, WEBP for shipping.
- Does it need transparency? → PNG (lossless) or WEBP (smaller).
- Does it need to scale infinitely? → SVG.
- Is it a screenshot with text? → PNG (sharp) or WEBP lossless.
Conversion workflow
For an existing image:
- Inspect it — photo? logo? screenshot?
- Resize to display dimensions using the Resize Image tool.
- Pick the target format and convert with the WEBP Converter, PNG to JPG, or JPG to PNG tools.
- Compress with the Compress Image tool and dial in quality against file size.
Serving strategy
For production, the modern stack is:
<picture>element with WEBP primary and JPG fallback.srcsetfor responsive sizes.- CDN that auto-converts and serves the right format per browser.
loading="lazy"anddecoding="async".
Conclusion
PNG, JPG, WEBP, SVG — four formats, four jobs. Pick by content type, ship WEBP as the default for raster, SVG for vector, and you're 95% of the way to optimal image delivery. The remaining 5% is responsive sizing and a CDN, which is a separate article.
Explore more tools
VoidForge ships 80+ free, private, browser-based tools. No signups, no uploads, no watermarks.
Browse all toolsRelated articles
PNG vs JPG: Which Image Format Should You Use?
PNG for logos, JPG for photos — mostly. Here's the full breakdown of when each format wins, where WEBP fits, and how to convert between them.
Best Free Image Compressors for the Web
Large images are the #1 cause of slow websites. Here's how to compress PNG, JPG and WEBP images losslessly — and when to use lossy instead.