Image guides
How to Convert JPG to AVIF in Your Browser
Both JPG and AVIF are lossy formats, so converting between them is about codec efficiency, not image quality — AVIF’s AV1-based encoder can often match JPEG’s look in a smaller file, when the browser supports producing it. This guide covers what that re-encode actually does and when it’s worth doing.
Ready to try the tool this guide describes?
How JPG becomes AVIF
- The browser’s JPEG decoder unpacks the DCT-compressed image data into a full grid of pixel values, the same step needed just to display the photo.
- That pixel grid is drawn onto a canvas — JPEG has no alpha channel, so there’s no transparency to carry through this step, only opaque color data.
- The canvas is encoded as AVIF using the browser’s AV1-based image encoder at your chosen quality setting, a second lossy compression pass layered on top of the JPEG that already happened.
- The resulting blob’s MIME type is checked to confirm it’s genuinely image/avif before the download is offered, so you never get a mislabeled file if encoding quietly fails.
What changes when you convert
You’re stacking two lossy codecs. AVIF’s encoder works only with the pixels JPEG’s decoder already reconstructed, so it can’t recover detail JPEG compression discarded when the photo was first saved — a higher AVIF quality setting keeps more of what’s currently there, not more of the original scene.
File size typically shrinks, since AV1-based compression is generally more efficient than JPEG’s at comparable visual quality — but that’s a tendency, not a guarantee. Highly compressed or low-detail JPGs sometimes don’t shrink much further.
Nothing changes regarding transparency: JPG never had an alpha channel, so the AVIF output is fully opaque, the same as the source. Dimensions and any orientation applied during decode carry through, but EXIF metadata itself is not copied into the AVIF.
When AVIF is the right choice — and when it isn’t
Converting makes sense when you’re preparing images for a site or app you know serves AVIF to modern browsers and want the smaller file size AVIF typically delivers for photographic content — a product gallery or blog with many large JPGs is a good candidate.
It’s not worth it for a one-off photo headed to email, an older device, or software you don’t control, where AVIF might simply fail to open. It’s also not the move if you’re hoping for a quality upgrade — re-encoding a JPG as AVIF cannot undo compression artifacts the JPEG already introduced; if that’s the concern, you’d need the original uncompressed source instead.
Limitations and privacy
AVIF encoding is Chromium-first: current Chrome, Edge, and similar browsers can produce it via canvas, but some others can’t yet, even though they may be able to open an existing AVIF file. On unsupported browsers, the tool shows a clear compatibility error instead of quietly saving something else with an .avif extension.
The quality slider runs 50–100% and defaults to 90%; there’s no lossless AVIF mode here. Everything happens locally — the JPG is decoded, redrawn, and encoded entirely in your browser, with no upload to a Looty Tools server.
Convert JPG to AVIF FAQ
- Why can’t AVIF encoding undo compression artifacts already in my JPG?
- AVIF’s encoder only has access to the pixels JPEG’s decoder reconstructs — any detail JPEG compression already discarded is gone before AVIF encoding starts. A higher quality setting preserves more of what remains, not what was lost.
- Why does my browser fail to produce an AVIF even though it can open one?
- Decoding and encoding AVIF are separate browser capabilities. Canvas-based AVIF encoding is currently Chromium-first, so some browsers that can display an AVIF file can’t yet create one.
- Is switching a whole JPG library to AVIF worth it?
- Usually only if the images are headed to a website or app you know serves AVIF to modern browsers. For photos going to email, older software, or audiences you don’t control, JPG’s broader compatibility is generally the safer bet.
- Does the AVIF output keep my JPG’s orientation and dimensions?
- Yes, dimensions carry through and orientation applied during decode is preserved in the pixels — but EXIF metadata itself, like camera and GPS data, is not copied into the AVIF file.
- Is my JPG uploaded anywhere before the AVIF downloads?
- No. Decoding, canvas encoding, and the MIME-type verification step all run locally in your browser.
Related guides
- JPG to AVIF Without UploadingSee how Looty Tools encodes JPG to AVIF in the browser, verifies a real AVIF download, and never uploads your photo for conversion.
- JPG vs AVIFCompare JPG and AVIF for everyday sharing, modern compression, quality trade-offs, and when converting JPG to AVIF makes sense.
- Convert JPG to WebPConvert a JPG or JPEG image to WebP locally with adjustable quality. Requires browser canvas WebP encoding support.