Tutorial6 min read·Updated

WebP in Next.js: next/image Plus Pre-Converted Assets

next/image will transcode to WebP/AVIF on the server. That costs CPU on first request and does not help remote CMS originals you cannot control. Pre-convert static heroes and marketing images to WebP at the sizes you actually request.

What next/image already does

The default loader negotiates WebP or AVIF and builds a srcset. For files in /public, the original is still read and transformed. A 4000 px PNG in public/hero.png means every cold start does extra work. Ship hero.webp at 1920 px and set sizes honestly.

Why it matters

  • Vercel image optimisation has a transform quota on some plans.
  • Self-hosted Next burns CPU on Sharp for every new size.
  • RemotePatterns images from CMSs stay huge unless you resize at the source.

How to do it

  1. List LCP images and OG images in app/ and public/.
  2. Bulk convert them to WebP at the largest sizes width you declare.
  3. Point next/image at the .webp (or keep the same basename and update imports).
  4. Leave formats: ['image/avif','image/webp'] on; it still helps leftovers.

Settings that work

Heroes 1920 px / 75–80%. Blog covers 1200 px / 80%. Icons as SVG. Quality 80 is the default you should match in the converter so local files look like production.

App Router tip

For statically imported images, Next reads dimensions at build time. WebP imports work the same as PNG. Prefer static imports for above-the-fold heroes so width/height are automatic.

Convert a batch in your browser. Nothing is uploaded.

Put it into practice

Convert your images to WebP right now, free and privately in your browser.

Open the converter

Frequently asked questions

The image optimiser can, on the fly. Pre-converting static marketing assets is still faster and cheaper.

No. Keep it for srcset. You just give it a smaller source.

OG images are often PNG from ImageResponse. That is fine. Page content images are the LCP problem.

Keep reading

Tutorial6 min read

WebP in Astro

Astro can transform images at build time. Pre-convert large photos to WebP so builds stay fast and pages stay light.

Read more
Tutorial6 min read

WebP in Nuxt

Nuxt Image can output WebP. Pre-convert public/ and CMS images so IPX does less work and LCP stays green.

Read more
Tutorial6 min read

picture element + WebP

Use <picture> to serve WebP with a JPEG fallback. When you still need it in 2026, and how to generate both files in one workflow.

Read more
Platforms6 min read

WebP for Contentful

Contentful's Images API can format=webp, but huge masters still cost transform time and origin weight. Pre-convert assets to WebP.

Read more