HTML does not define one universal list of image formats. The browser (user agent) decides what an <img> or <picture> source can decode. In ordinary web development, evaluate JPEG, PNG, GIF, SVG, WebP, AVIF and APNG, using the MIME types image/jpeg, image/png, image/gif, image/svg+xml, image/webp, image/avif and image/apng. Use modern formats when they suit the asset, and provide a fallback when browser coverage is uncertain. MDN documents the browser-dependent rule and the relevant MIME types in its MIME-type reference.
What HTML actually guarantees
The HTML specification does not force every browser to implement the same image decoder. MDN’s <img> documentation puts it plainly: “The HTML standard doesn’t list what image formats to support, so user agents may support different formats.” The practical result is that a file extension is not a guarantee of display. The browser must recognize the format, and your server should send a matching media type.
These are the MIME types you will most often encounter:
| Format | Common extensions | MIME type |
|---|---|---|
| JPEG | .jpg, .jpeg, .jfif, .pjpeg, .pjp | image/jpeg |
| PNG | .png | image/png |
| GIF | .gif | image/gif |
| SVG | .svg | image/svg+xml |
| WebP | .webp | image/webp |
| AVIF | .avif | image/avif |
| APNG | .apng or .png | image/apng |
For a current browser-support overview and format details, see MDN’s image-format guide.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
The image formats developers should know
JPEG: photographs and complex color
JPEG uses lossy compression. It is a strong default for photographs, product images and other continuous-tone scenes when you do not need transparency. Repeatedly re-saving a JPEG can introduce visible artifacts, so keep a high-quality source and create delivery copies from it.
JPEG is not designed for an alpha channel. A transparent logo or overlay therefore needs a different format, or a deliberately chosen solid background.
PNG: lossless detail and transparency
PNG uses lossless compression. It is well suited to screenshots, diagrams, interface captures, line art and images that need transparent pixels. Text and sharp edges generally remain cleaner than they would in a heavily compressed photographic JPEG.
The trade-off is file size: a large photographic PNG is often much heavier than an equivalent JPEG, WebP or AVIF. Use PNG when exact pixels or alpha transparency matter, not simply because it is familiar.
GIF: compatibility and simple animation
GIF is broadly compatible and can carry simple animation. It remains useful for small, uncomplicated animated graphics where maximum historical compatibility is important.
GIF’s palette and compression model are relatively limited, so modern animated WebP, AVIF or APNG may deliver better quality or smaller files when the audience supports them. Do not convert an animation automatically without checking motion, transparency and fallback requirements.
SVG: scalable vectors
SVG is a vector format for logos, icons, diagrams and artwork that must stay sharp at different display sizes. A single SVG can scale without the pixelation associated with a fixed raster image.
SVG is most appropriate when the source is genuinely vector artwork. A photograph placed inside an SVG does not become a smaller or more scalable photograph; it is still carrying raster data.
WebP: a modern general-purpose option
WebP supports lossy and lossless compression, transparency and animation. MDN describes it as a strong modern choice with broad current-browser support. It can therefore cover photographs, transparent interface assets and some animated content with one family of files.
Keep a fallback when you still serve older or constrained clients, when a partner system accepts only JPEG or PNG, or when your support policy requires a format with deeper historical coverage.
AVIF: high compression with a fallback plan
AVIF is a high-performance, royalty-free format that supports transparency, animation and high color depth. It is attractive for bandwidth-sensitive photographic imagery and other assets where compression efficiency matters.
AVIF has less historical browser-support depth than JPEG or PNG. Offer it as a preferred source and put a broadly compatible image in the nested <img> element, rather than making AVIF your only URL.
APNG: lossless animation
APNG provides lossless animation and is useful when animation quality matters and the target browser set accepts it. The format may use an .apng extension or a .png extension, so the declared type and actual file matter more than the suffix alone.
Formats that need a specific compatibility decision
BMP and ICO
Major browsers recognize BMP and ICO, but MDN lists them as generally less suitable for ordinary web content. ICO is useful in its traditional favicon role; BMP is usually a poor delivery choice because it does not provide the compression expected of web images.
Rank #3
TIFF
TIFF has limited browser support. Use it as an archival or editing source rather than assuming an ordinary web page can display it directly. Export a web delivery copy in a supported format.
JPEG XL
JPEG XL support is not universal. If you use it, pair it with a fallback and verify the exact browsers and embedded webviews your audience uses. Do not label it as a universally safe replacement for JPEG.
Recommended Free Tools
How to provide fallbacks with <picture>
An <img> element by itself has one source URL; it does not contain a format-fallback list. The <picture> element lets the browser test preferred sources in order and then use the nested <img> as the fallback:
<picture>
<source srcset="hero.avif" type="image/avif">
<source srcset="hero.webp" type="image/webp">
<img src="hero.jpg" alt="Description of the image">
</picture>
The browser selects the first supported <source>. If neither AVIF nor WebP is supported, it loads hero.jpg. The fallback <img> should always have meaningful alternative text, or an empty alt when the image is purely decorative.
Adding responsive dimensions
You can give each source a responsive srcset and sizes value. Keep the format type on every <source>, and make sure each URL really contains the declared format:
<picture>
<source
type="image/avif"
srcset="hero-640.avif 640w, hero-1280.avif 1280w"
sizes="(max-width: 700px) 100vw, 700px">
<source
type="image/webp"
srcset="hero-640.webp 640w, hero-1280.webp 1280w"
sizes="(max-width: 700px) 100vw, 700px">
<img
src="hero-1280.jpg"
srcset="hero-640.jpg 640w, hero-1280.jpg 1280w"
sizes="(max-width: 700px) 100vw, 700px"
width="1280"
height="720"
alt="Description of the image">
</picture>
The width and height attributes reserve layout space while the image loads. They should reflect the image’s intrinsic aspect ratio; they do not resize the file on the server.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →A format-selection workflow
- Identify the source. Choose SVG for genuinely vector artwork, JPEG for photographs without transparency, PNG for lossless detail or alpha transparency, and an animated format only when motion is required.
- Check delivery constraints. Decide whether the audience includes older browsers, embedded webviews or systems that accept only traditional formats. That decision determines whether a fallback is mandatory.
- Generate modern variants. Create WebP or AVIF copies when their compression benefits justify another asset, while retaining a JPEG or PNG fallback where compatibility calls for it.
- Write a
<picture>chain. Put the preferred modern source first, then the next-best supported source, and finish with a correctly described<img>. - Test the real files. Open the page in the browser versions and devices you support. Check that the response has the expected MIME type, the image has the intended dimensions, transparency survives, and animation behaves as expected.
- Measure the result. Compare visual quality and transfer size for the actual assets. A smaller file is not an improvement if text becomes unreadable, gradients band or transparency is lost.
Common problems and fixes
The image icon or alt text appears instead of the picture
First check the URL in the browser directly and inspect the network response. A misspelled path, a 404 response, a permission rule or a response with the wrong media type can all prevent decoding. Correct the URL and server configuration, then reload without an old cache.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
AVIF or WebP works on one device but not another
That is a format-support difference, not an HTML syntax problem. Put the modern source in <picture> and retain a JPEG or PNG fallback. Test the fallback by temporarily disabling or removing the modern source.
The browser downloads a file instead of displaying it
Verify that the server sends an image media type such as image/webp or image/avif, rather than a generic download type. Also check that a content-disposition rule is not forcing attachment downloads.
Transparency becomes a solid color
Confirm that the selected file actually includes an alpha channel. JPEG cannot carry transparency. Use PNG, WebP, AVIF or an SVG whose artwork defines the required transparency.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteAn animated file displays only one frame
Check whether the source is actually animated and whether the selected format is supported by the target browser. A static fallback is expected to show one frame; place an animated source before it and verify the source order.
The picture is blurry or unexpectedly large
Inspect the intrinsic dimensions and the selected srcset candidate. A low-resolution file stretched into a large slot will look soft; a huge source sent to a small slot wastes bytes. Generate appropriately sized variants and ensure the sizes value describes the rendered width.
Or skip the browser setup
If you need a clean screenshot of a web page to use as a PNG, JPEG or WebP asset, ScreenshotNeo provides a website screenshot API and MCP server. A single request can capture a URL without you installing or scripting a headless browser. Its cleanup step accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup action can be turned off.
Only clean shots are billed. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and the response identifies the result with the X-Page-Verdict and X-Billed headers. An MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.
cURL
See the ScreenshotNeo documentation for authentication and options. This request writes the returned image to a WebP file:
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo includes every feature on every plan: full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets plus custom viewports, retina scale, PDF controls, custom CSS and JavaScript, pre-capture clicks, hidden selectors, selector or network-idle waits, request and resource blocking, custom headers/cookies/user agents and Authorization, timezone and geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify a migration.
The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; yearly billing gives two months free. Create a free ScreenshotNeo account to try it without a card.
FAQ
Can I use the same fallback image for every format?
Yes. The nested <img> can point to one reliable JPEG or PNG while preferred <source> elements offer WebP or AVIF to capable browsers. Choose a fallback that preserves the important visual details and transparency requirements.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Does an image extension prove which format the browser received?
No. The extension is only part of the URL. The file’s actual encoding and the HTTP response’s media type must agree; inspect the response and test decoding when a file behaves unexpectedly.
Frequently Asked Questions
Can I use the same fallback image for every format?
Yes. The nested <img> can point to one reliable JPEG or PNG while preferred <source> elements offer WebP or AVIF to capable browsers. Choose a fallback that preserves the important visual details and transparency requirements.
Does an image extension prove which format the browser received?
No. The extension is only part of the URL. The file’s actual encoding and the HTTP response’s media type must agree; inspect the response and test decoding when a file behaves unexpectedly.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

