Pick the wrong image format and a page loads slowly, a screenshot looks smudged, or an upload form refuses your file. Each format makes a different trade-off between file size, quality, and features such as transparency. This guide explains how they differ so you can choose quickly.
Lossy and lossless compression
Image formats fall into two groups:
- Lossy formats, such as JPEG, discard some detail that the eye is unlikely to notice. They produce much smaller files, but quality drops each time the image is saved again, and heavy compression shows as blocks or blur.
- Lossless formats, such as PNG, keep every pixel exactly. Files are larger, but nothing is lost, which matters for text, line art, and images you will edit again.
WebP and AVIF can work in either mode.
JPEG
JPEG is the standard format for photographs. It handles smooth gradients and natural scenes well and lets you trade quality for size with a single quality setting.
- Good for: photos, large images with many colors, upload forms that ask for a small file.
- Weak at: sharp text and thin lines, which can show fuzzy edges around them. It has no transparency.
- Compatibility: accepted almost everywhere. If a form says "image" and nothing else, JPEG is the safest choice.
PNG
PNG is lossless and supports full transparency, including soft semi-transparent edges.
- Good for: screenshots, logos, icons, diagrams, and anything with flat colors and sharp edges. Also for images with transparent backgrounds.
- Weak at: photographs. A photo saved as PNG is often several times larger than the same photo as a JPEG, because there is a lot of fine detail to store exactly.
- Compatibility: universal.
WebP
WebP was developed by Google and supports lossy and lossless compression, transparency, and animation in one format. At similar visual quality, a lossy WebP is commonly smaller than the matching JPEG, and a lossless WebP is commonly smaller than the matching PNG.
- Good for: websites that want smaller image files without losing transparency.
- Weak at: compatibility with older software. Current browsers support it, but some upload forms, email clients, and desktop programs still reject it.
GIF
GIF is limited to 256 colors per frame, which makes photos look blotchy. Its remaining strength is simple animation that works everywhere. For short animations, modern video formats or animated WebP are usually smaller and look better.
AVIF
AVIF is a newer format that often compresses even better than WebP. The trade-offs are that encoding can be slow and support in older software is more limited than JPEG or PNG. It is a reasonable choice for a website you control, and a poor one for a file you are sending to someone else.
HEIC
HEIC is what iPhones use by default. It is efficient, but many websites and browsers cannot open it. If you need to share or upload an iPhone photo, convert it to JPEG first. See How to convert iPhone HEIC photos to JPEG.
Quick chooser
| You have | Use | |---|---| | A photograph | JPEG, or WebP on your own website | | A screenshot with text | PNG | | A logo or icon with a transparent background | PNG, or SVG if it is a vector graphic | | An image for a form with a size limit | JPEG | | A short animation | Animated WebP or video; GIF only if you need maximum compatibility | | An iPhone photo you need to upload | JPEG |
For logos and icons that are drawn with shapes rather than captured with a camera, SVG is a better choice than any of these, because it stays sharp at every size and is usually tiny.
Why the same picture gives such different file sizes
File size depends on dimensions, format, quality setting, and content. A busy photo with fine texture is expensive to store at any quality, while a flat graphic is cheap. Reducing the pixel dimensions has the largest effect: halving the width and height leaves a quarter of the pixels.
Converting without wasting quality
- Start from the original file, not from a copy that was already compressed. Each lossy save adds artifacts.
- Do not convert a JPEG to PNG expecting better quality. The detail already lost cannot be recovered, and the file just gets bigger.
- When you need a specific file size, adjust quality first, then dimensions if needed. The Compress Image to Size tool does this automatically and lets you choose JPEG or WebP. For the full method, read How to compress an image to a specific file size.