PNG vs JPG vs WebP vs AVIF: which image format should you use?

Dan Counsell · Founder of Realmac SoftwareUpdated

We’ve made Squash, an image compressor for Mac, since 2016, so we show the free way first.

Picking the right format is the easiest way to get a smaller file. A photo saved as PNG can be five times the size of the same photo as JPG, and the same photo as AVIF can be smaller again. Here’s how the five common formats compare, and when to use each.

The short version

Format Use it for Avoid it for Transparency Lossy or lossless
JPG (JPEG) Photos to send, print or upload anywhere Text, logos, screenshots No Lossy
PNG Screenshots, logos, graphics, anything with text Photos Yes Lossless
WebP Website photos and graphics Print Yes Both
AVIF Website photos, smallest files Very old browsers and apps Yes Both
HEIC Photos kept on iPhone, iPad and Mac Sharing with PCs and websites Yes Lossy

Lossy vs lossless

Lossy formats (JPG, and WebP, AVIF and HEIC in their usual modes) throw away detail your eye won’t miss. Files are small, and the quality setting decides how much is lost. Saving a lossy file again and again slowly degrades it.

Lossless formats (PNG, and WebP or AVIF in lossless mode) keep every pixel exactly. Files are bigger, but text and sharp edges stay crisp.

PNG vs JPG

Use JPG for photographs. Their soft gradients compress well, and nobody can see the loss at a sensible quality.

Use PNG for screenshots, diagrams, logos and anything with text or flat colour. JPG puts faint smudges around sharp edges, and can’t do transparent backgrounds.

If you’ve got a big PNG photo, convert it to JPG.

WebP vs JPG and PNG

WebP was made by Google for the web. It does both jobs: lossy for photos, at a smaller size than JPG, and lossless with transparency for graphics, usually smaller than PNG. Every current browser supports it, so it’s a safe default for a website.

AVIF vs WebP

AVIF is newer and usually makes smaller photos than WebP at the same quality, and supports HDR. It’s slower to save, and a few older apps can’t open it. For website photos, try AVIF first. Read what an AVIF file is.

Where HEIC fits

HEIC is what your iPhone uses. It’s excellent for storing photos, at about half the size of JPG, but websites and many PCs can’t open it. Read what a HEIC file is.

Convert between formats on a Mac

Preview converts between JPG, PNG, HEIC and TIFF: choose File > Export and pick a format. It can’t save WebP or AVIF. Squash exports JPEG, PNG, WebP, AVIF, HEIC, TIFF and JPEG XL, for a whole batch at once.

Questions about image formats

What is the best image format for a website?

AVIF or WebP for photos, WebP or SVG for graphics and logos. Both are supported by every current browser and make much smaller files than JPG and PNG.

Is PNG higher quality than JPG?

PNG is lossless, so it never loses detail, but for photos a high-quality JPG looks the same at a fraction of the size. PNG is better for text, logos and screenshots.

Should I save photos as PNG or JPG?

JPG. A photo saved as PNG is much larger with no visible benefit.

What about JPEG XL?

JPEG XL is a newer format with excellent compression and a lossless way to shrink existing JPEGs. Apple’s software supports it, but not every browser does yet, so check before you use it on a website.

All Squash guides →

Get Squash for Mac

Compress, resize and convert whole batches of images on your Mac. Free to download, with no watermark.

Download

Confirm your email and we'll send your code. Unsubscribe any time. Privacy policy