How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Sanity image URL: Specify fallback format when browser doesn't support webp

6 repliesLast updated: Nov 29, 2025

Hi, quick question:when generating a url for my images in the front-end there’s the option to use
auto=format
to automatically use
webp
as image format if the browser supports it. is there a way to specify a fallback format (eg i want to use
jpg
if the original image file is uploaded as
png
) if the browser doesn’t?
AI Update

Based on Sanity's image transformation documentation, there isn't a built-in fallback format parameter when using auto=format.

Here's how auto=format works:

When you use ?auto=format, Sanity automatically serves the most optimized format based on the browser's Accept header:

The key point: The fallback is determined by your original uploaded image format, not by a parameter you can specify. If you upload a PNG, browsers that don't support WebP/AVIF will get PNG. If you upload a JPG, they'll get JPG.

Your options:

Unfortunately, there's no single parameter like ?auto=format&fallback=jpg in Sanity's image pipeline. The fallback format is inherently tied to your source image format when using auto=format.

Show original thread
6 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions