The best image format for most websites depends on what the image shows. Use WebP or AVIF for photos (with JPEG as a safe fallback), SVG for logos and icons, and PNG when you need a pixel-perfect graphic with transparency. GIF is now mainly useful for very small, simple animations.
This guide compares each format, shows which one to pick for common jobs, explains browser support, and covers how to offer a modern format with a fallback.
The six formats at a glance
Web images fall into two families. Raster formats (JPEG, PNG, GIF, WebP, AVIF) store a grid of pixels, so they look soft or blocky if you scale them up. Vector formats (SVG) store shapes as instructions, so they stay sharp at any size.
Raster formats also differ in how they compress. Lossy compression throws away detail you are unlikely to notice to make files much smaller. Lossless compression keeps every pixel exactly but produces larger files for photos.
| Format | Type | Transparency | Animation | Best for |
|---|---|---|---|---|
| JPEG | Raster, lossy | No | No | Photos, as a universal fallback |
| PNG | Raster, lossless | Yes | No (APNG aside) | Screenshots, graphics with sharp edges or text |
| GIF | Raster, lossless, 256 colors | Yes (on/off only) | Yes | Tiny, simple animations |
| WebP | Raster, lossy or lossless | Yes | Yes | Photos and graphics, smaller than JPEG or PNG |
| AVIF | Raster, lossy or lossless | Yes | Yes | Photos where you want the smallest files |
| SVG | Vector | Yes | Yes (with CSS) | Logos, icons, simple illustrations |
Which format to use for each job
Photos
Photos have smooth gradients and millions of colors, which suits lossy compression. WebP files are usually noticeably smaller than JPEG at similar quality, and AVIF often goes smaller still. JPEG remains a perfectly good choice if you want one file that works everywhere, including in old software and email.
Logos and icons
Use SVG whenever you have a vector version of the artwork. A logo exported as SVG is often only a few kilobytes and looks crisp on high-resolution screens without needing extra copies. If you only have a raster logo, use PNG or lossless WebP so edges stay clean and the background can be transparent.
Screenshots and diagrams
Screenshots contain text and flat areas of color. JPEG tends to blur text and add speckles around sharp edges. PNG or lossless WebP keeps them clean. For a diagram you drew yourself, SVG is often the best option.
Animations
GIF is limited to 256 colors and produces large files for anything longer than a few frames. Animated WebP or AVIF can be much smaller. For longer clips, a short muted HTML5 video is usually lighter than any animated image.
Browser support in plain terms
JPEG, PNG, GIF and SVG work in every browser you need to care about. WebP is supported by all current major browsers, including Chrome, Edge, Firefox and Safari.
AVIF is newer. Chrome added it in version 85, Firefox in version 93, Safari in version 16.4 and Edge in version 121. That covers current versions of every major browser, but some older phones, tablets and computers that no longer get updates will not display AVIF. If a meaningful share of your visitors might use older devices, offer a fallback.
Support is about the browser, not just the operating system. A visitor on an old Mac or an old iPhone that cannot update Safari may not see AVIF images, even though the format works on the same model running newer software.
How to offer AVIF or WebP with a fallback
The HTML <picture> element lets you list several formats. The browser uses the first one it supports and falls back to the plain <img> at the end. A typical pattern looks like this:
<picture><source srcset="images/team.avif" type="image/avif"><source srcset="images/team.webp" type="image/webp"><img src="images/team.jpg" alt="Our team outside the office" width="1200" height="800"></picture>
Put the alt, width and height on the <img> element. The width and height let the browser reserve space before the image loads, so the page does not jump around. If you only want one format, a single WebP or JPEG in a normal <img> tag is fine for most small sites.
Size matters more than format
Picking a modern format helps, but the biggest savings usually come from using the right dimensions. A photo straight from a phone camera can be several thousand pixels wide. If it is displayed 800 pixels wide on your page, visitors still download the full file.
- Resize first. Export the image at roughly the largest size it will appear, or about twice that for sharp display on high-resolution screens.
- Compress next. In your image editor or export tool, lower the quality setting until you just start to see a difference, then step back up a little.
- Pick the format last. Use the table above to choose based on the content of the image.
- Name files clearly. Lowercase names with hyphens, such as
red-bike-front.webp, avoid case and space problems when you upload.
Resizing an image with HTML width and height attributes or CSS changes how big it looks, not how big the file is. To make the file itself smaller, you need an image editor or conversion tool.
Quick decision checklist
- Is it a logo, icon or simple drawing that exists as vector art? Use SVG.
- Is it a photo? Use WebP or AVIF, with JPEG as a fallback if you want maximum compatibility.
- Is it a screenshot or graphic with text and hard edges? Use PNG or lossless WebP.
- Does it need transparency? Avoid JPEG. Use PNG, WebP, AVIF or SVG.
- Is it a short animation? Try animated WebP, or a small video for anything longer.
The easier way: insert any web image format in Apollo Editor
Once your images are exported, Apollo Editor makes placing them straightforward. It works with JPEG, PNG, GIF, WebP and SVG, and AVIF where supported, so you can use the format that suits each image.
- Drag an image onto the page in Design mode or choose a file, then see a preview right away.
- Set alt text, size, alignment and responsive image attributes in the Image Properties dialog.
- Paths are managed as relative links, so images keep working when you publish the site.
- Check the result at desktop, tablet and mobile sizes in Preview mode.
Apollo Editor does not include an image editor or converter, so resize and compress in your usual tool first. For the next steps, see how to insert an image in HTML, how to write alt text and what to do when images are not showing.
Frequently asked questions
Is WebP better than JPEG?
WebP files are usually smaller than JPEG at similar quality and are supported by all current major browsers, so it is a good choice for photos.
When should I use SVG?
For logos, icons and simple illustrations. SVG is a vector format, so it stays sharp at any size and is often very small.
Should I use AVIF images?
AVIF often gives the smallest files and is supported by current major browsers, but very old browsers lack support, so a fallback can help.
