Skip to main content
Free tool

PNG and JPG to WebP or AVIF converter

Convert a batch of images in your browser and compare the size before and after. Nothing is uploaded.

  • Free
  • No account required
Target format
80
Drop images or click to choose
JPG, PNG, BMP, GIF (first frame), converted locally in your browser

Conversion runs in your browser and the images stay on your device.

EXIF metadata is not carried through canvas encoding: output files have no location or camera data.

Files: 0 WEBP, 80
Before
–
After
–
Saved
–

Add images to see their size before and after conversion.

About the tool

Why convert images to AVIF or WebP?

AVIF and WebP usually produce much smaller files at quality close to JPG/PNG.

A smaller image loads sooner, which helps LCP and cuts transfer. Across many pages it also lowers the CO₂e estimate in the Ecology module.

Conversion is local (canvas). Images never leave the browser, and with a large batch the pace is limited by your device memory and CPU.

In practice

Compare quality on real images

Test photos, graphics containing text and transparent images separately. Inspect fine edges and tonal transitions. The smallest file is not always the best choice if details are visibly lost.

web.dev, Image formats
Step by step

How to convert JPG and PNG to WebP or AVIF

You convert an image to WebP or AVIF at its display size, then add it with a fallback for older browsers. Five steps take you from the source file to checking the image on the page.

  1. Prepare the image at its display size

    The converter keeps the original dimensions. If a photo is 4000 px wide and the page shows it at 1200 px, resize it first, because a new format does not replace resizing.

  2. Choose WebP or AVIF

    Drop one or more JPG, PNG, BMP or GIF files and pick the target format. AVIF usually gives a smaller file, but encoding depends on the browser. When the browser cannot write AVIF, the tool converts to WebP and tells you.

  3. Set the quality and compare the size

    The quality slider runs from 40 to 100. Start at 80, compare the size before and after for each file and zoom in on the result, especially text and sharp edges.

  4. Add the image with a fallback

    Use a <picture> element: the AVIF source first, then WebP, and the JPG or PNG file in <img>. Keep the width and height attributes so the browser reserves the space.

  5. Check the LCP image on the page

    If the image is the largest element in the first view, do not give it loading="lazy" and consider fetchpriority="high". Check the effect with a performance audit of the same page before and after the change.

Examples

Examples of adding WebP and AVIF images in HTML

Two patterns that cover most cases: an image with a fallback, and the main image of the first view.

AVIF and WebP image with a JPG fallback
<picture>
  <source srcset="/img/hero.avif" type="image/avif">
  <source srcset="/img/hero.webp" type="image/webp">
  <img src="/img/hero.jpg" width="1200" height="630"
       alt="Image description">
</picture>

The browser picks the first format it supports. An older browser without AVIF or WebP downloads the JPG file.

Main image of the first view
Before
<img src="/img/hero.jpg" loading="lazy"
     alt="Image description">
After
<img src="/img/hero.webp" width="1200" height="630"
     fetchpriority="high" alt="Image description">

According to web.dev, lazy-loading the LCP image always delays its download. Dimensions in the attributes let the browser reserve the space and limit CLS.

Common mistakes

Common mistakes when converting images to WebP and AVIF

  • A new format without resizing

    A 4000 px photo in WebP is still much heavier than the same photo at the width the page shows it. Set the dimensions first, then change the format.

  • AVIF without a fallback

    According to web.dev, Chrome has supported AVIF since 2020, Firefox since 2021 and Safari since 2022. An older browser cannot display a format it does not know, so add AVIF in <picture> with WebP or JPG.

  • Lazy-loading the LCP image

    The loading="lazy" attribute on the main image of the first view delays its download and hurts LCP. Keep lazy loading for images below the first screen.

  • Missing width and height attributes

    Without dimensions the browser does not know how much space to leave, and content shifts once the image arrives. Set width and height, or aspect-ratio in CSS.

  • Overwriting the originals

    Conversion is lossy and, because it goes through canvas, strips metadata, including copyright information. Each new conversion of an already compressed file adds more loss, so keep the originals separately.

Numbers and sources

Images on real pages and WebP and AVIF in numbers

ValueWhat it meansSource
68%Share of mobile pages whose LCP element contains an image, in 2024.Web Almanac 2024, Media
911 KBMedian image bytes on a mobile home page in 2025, the largest of all resource types.Web Almanac 2025, Page Weight
12% and 1%Share of WebP and AVIF among images on mobile pages in 2024. JPEG had 32.4%, PNG 28.4%.Web Almanac 2024, Media
25 to 34%How much smaller lossy WebP files are than comparable JPEG files at equal SSIM quality.Google, WebP
26%How much smaller lossless WebP files are than PNG files.Google, WebP
2022The year Safari added AVIF support. Chrome and Opera have supported it since 2020, Firefox since 2021.web.dev, AVIF

Sources checked:

Formats

Which format to pick?

AVIFAV1 Image Format
Often the smallest modern option. Needs browser encode support.
WebPWeb Picture Format
Wide support, solid size/compatibility trade-off.
JPGJPEG
Legacy standard without transparency, often a fallback.
PNG
Lossless with transparency. WebP/AVIF usually cuts transfer a lot.
Ecology module in Insight

File or code ready? Check the result on the live page

A CO₂e estimate and asset weight, broken down by source, with a reduction plan.