Best Image Format for Websites: JPEG, PNG, WebP or AVIF
By Ismail, Founder of Filoshi
Which image format to use on a website in 2026: photos, graphics, logos and animations, with browser support, fallbacks and quality settings that work.
For photos on a website, serve AVIF or WebP, with a JPEG fallback where you need one. For screenshots, diagrams and anything with sharp edges or text, use a lossless format: lossless WebP or PNG. For logos and icons, use SVG. For short animations, use a muted, looping video instead of a GIF. That covers almost every image on almost every site, and it's also what Mozilla's documentation recommends.
Below is the reasoning behind each choice, the browser support as of October 2026, and the settings that matter more than the format itself.
The decision table
| What the image is | First choice | Fallback | Watch out for |
|---|---|---|---|
| Photo | AVIF or WebP (lossy) | JPEG | Oversized pixel dimensions |
| Screenshot, chart, line art | Lossless WebP or PNG | PNG | Lossy settings blurring text |
| Logo, icon, diagram | SVG | PNG or WebP | SVGs from untrusted sources |
| Image with transparency | WebP or AVIF | PNG | JPEG can't store transparency |
| Short animation | MP4 or WebM video | Animated WebP, then GIF | GIF file sizes |
Mozilla's image format guide puts it the same way: for raster images, "prefer WebP or AVIF, which generally provide better compression than PNG, JPEG, and GIF"; for diagrams, charts and other images that must be drawn accurately at different sizes, use SVG; and for screenshots, diagrams, logos and line art, prefer lossless encoding, "as blurring and colored fringes around text and sharp edges are very visible" (MDN image file type guide).
Photos: JPEG, WebP or AVIF?
JPEG is still the universal photo format, and MDN calls it a good fallback for photographs. It has no transparency, but every browser, email app and image editor reads it.
WebP was developed by Google as a lossy format to supersede JPEG and later gained a lossless mode (web.dev on WebP). Google's own study found WebP files 25 to 34% smaller than JPEG at the same measured quality (Google's WebP compression study). That's a large saving for a site that serves thousands of photos a day.
AVIF is based on the open-source AV1 video codec and aims for "improved perceptual quality at file sizes smaller than JPEG or WebP", according to web.dev, which cites testing by Netflix, Cloudinary and Chrome's codecs team (web.dev on AVIF). It also supports transparency and animation. What is AVIF? covers it in detail.
In practice: AVIF often gives the smallest file, WebP is close behind with the longer track record, and JPEG is the fallback that always works. If you can only do one modern format, WebP is the low-risk choice; if your image pipeline or CDN can generate both, offer AVIF first and WebP second. PNG vs WebP compares those two in detail. If you're the photographer making the originals, RAW vs JPEG covers what to shoot and keep before any of this.
Graphics, screenshots and transparency
Lossy compression is tuned for photos. On flat colors, thin lines and text it produces visible smudges and colored fringes. That's why MDN recommends lossless encoding for screenshots, logos and line art.
Lossless WebP is the modern swap for PNG: identical pixels in a smaller file. Google measured lossless WebP as 23% smaller than PNGs optimized with ZopfliPNG and 42% smaller than standard libpng output (Google's lossless and alpha study). PNG stays the right choice when the image has to work in older software, in print workflows, or as an editable master.
Logos and icons: SVG
SVG stores shapes rather than pixels, so a logo stays sharp at any size and is usually tiny. Mozilla's guide says most icons have vector versions, and that you should prioritize the SVG version whenever possible. Only accept SVG files you or your designer created, though: an SVG is code, and one from an unknown source can contain scripts. SVG vs PNG explains vector and raster images.
Animation: video beats GIF
GIF is the worst way to put motion on a page. Each frame is limited to a palette of at most 256 colors, and its compression wasn't designed for video. web.dev's example makes the point: an animation that was 3.7 MB as a GIF became 551 KB as an MP4 and 341 KB as WebM (web.dev: replace animated GIFs with video). A <video> element with the autoplay, loop, muted and playsinline attributes behaves just like a GIF. GIF vs MP4 vs WebP covers the cases where GIF is still the only option.
Serving modern formats safely
Browser support for the modern formats is now broad. MDN's compatibility data lists AVIF from Chrome 85, Edge 121, Firefox 93 and Safari 16.1, and WebP in all versions of Chrome, Edge, Firefox, Opera and Safari (on macOS, Safari 14 or later on macOS Big Sur or later). Older browsers and some crawlers and apps still need a fallback, and the standard way to provide one is the <picture> element:
- List the most efficient format first, for example
<source type="image/avif">, then<source type="image/webp">. - End with a normal
<img>pointing at the JPEG or PNG. Browsers use the first source they support, and anything that doesn't understand<picture>uses the<img>.
Google gives the same advice for search: always specify a fallback URL in the src attribute, because some browsers and crawlers don't understand <picture> or srcset (Google's image SEO guide). Many image CDNs and site builders now do the format negotiation for you, which is the easiest route if your platform offers it.
Settings that matter more than the format
Pixel dimensions
A 4000-pixel-wide photo shown 800 pixels wide wastes most of its bytes, whatever the format. Resize to the largest size the layout actually shows, and use srcset and sizes to offer smaller versions to smaller screens. MDN explains how the browser then picks a candidate based on the intended display size. DPI, PPI and pixels clears up how image size works on screens.
Quality
JPEG, WebP and AVIF all have a quality setting from 0 to 100, and tools interpret the same number differently. web.dev's advice is practical: it's "almost always a safe bet to nudge JPEG compression just a little lower than you think might be noticeable." In its example, a quality of 60 cut a JPEG's size by 79%. Test with your own images at 100% zoom. JPEG quality settings explained walks through how to choose.
Width, height and lazy loading
Give every <img> its width and height so the browser can reserve space and avoid layout shift, and add loading="lazy" to images below the first screen. MDN notes that lazy loading defers an image until it nears the viewport, saving bandwidth for images the visitor may never scroll to.
Images and SEO
Format alone won't rank a page, but it affects speed, and Google notes that images are often the largest contributor to overall page size. Google Search indexes images in BMP, GIF, JPEG, PNG, WebP, SVG and AVIF. Its guide puts the most weight on alt text: describe the image in context and don't stuff keywords. Short, descriptive file names help too, so red-trail-shoes.webp beats IMG_0412.webp.
Email and social media are different
Everything above is about web pages. Email apps vary much more in what they display, so JPEG for photos and PNG for graphics remain the safe choice in newsletters. For social media, follow each platform's own upload guidance; a high-quality JPEG or PNG is the usual safe starting point.
Converting a whole site's images
Most sites end up with a folder of JPEGs and PNGs that need WebP or AVIF copies. Filoshi does that on your PC, so the images aren't uploaded anywhere: select the files, drop them on the window, pick one format for all of them and press Convert all. JPG to WebP, PNG to WebP and JPG to AVIF all passed its automated test matrix, as did PNG to JPG for photos saved in the wrong format.
One setting to change: Filoshi's default image quality is 100, which keeps the most detail but makes large files. For web images, lower the quality in the file viewer, and resize there too. The same viewer has a "Remove location and camera data" switch for photos you publish. The originals are never changed, so you can always make another set. For a handful of images, Squoosh, the free web app web.dev uses in its examples, is a good alternative.
I make Filoshi, so weigh what I say about it accordingly. The facts about formats and Windows are linked to their sources.
Frequently asked questions
Should I use AVIF or WebP in 2026?
Both are safe for modern browsers. MDN lists AVIF from Chrome 85, Firefox 93 and Safari 16.1, and WebP in all current major browsers. AVIF often produces smaller photos, while WebP has been supported in browsers for longer. If you can serve both, list AVIF first and WebP second in a picture element, with a JPEG fallback.
Does image format affect SEO?
Indirectly. Google Search indexes BMP, GIF, JPEG, PNG, WebP, SVG and AVIF, so any of those can rank. What format changes is file size, and Google notes images are often the largest part of a page's weight, which affects speed. Alt text, descriptive file names and correctly sized images matter more than the format itself.
Do I still need JPEG fallbacks?
For most visitors, no, since current browsers all read WebP and AVIF. But Google recommends always giving a fallback in the img element's src attribute, because some browsers and crawlers don't understand picture or srcset. A picture element with AVIF and WebP sources and a JPEG img costs little and covers everyone.
What's the best format for images in email?
JPEG for photos and PNG for logos and graphics. Email apps vary much more than browsers in what they display, so newer formats like WebP and AVIF are a risk in newsletters. Keep email images small in pixel dimensions too, since many people read on phones and on slow connections.
RAW vs JPEG: What Photographers Should Shoot and Keep
Next →Video Containers vs Codecs: MP4, MKV, H.264, HEVC, AV1
Ready to convert files privately?
1,841 tested conversions. No uploads. No accounts. Runs entirely on your machine.
Get Filoshi · $29