Nimble Toolbox

Convert JPG to AVIF

Drop in your JPG, JPEG, or JFIF files and download AVIF files. Browsers cannot write AVIF themselves, so this page brings its own encoder, and your photos stay on your device.

Converted

Converted files appear here.

    How to use it#

    1. Drop your JPG files onto the box above, or click it to pick them.
    2. Leave Compression on Lossy and move the quality slider until the size in each row looks right. Each change encodes the files again, which takes a moment for a large photo.
    3. Download the results one at a time, or take the whole batch.

    How much smaller a photo gets#

    AVIF describes a photograph in far fewer bytes than JPG for the same look, which makes it worth serving on any page that has to load quickly. In testing at the starting 60%, a 512 pixel photo of a zebra saved as a JPG went from 122 KB to 26 KB, and one of a parrot from 76 KB to 16 KB, with no difference visible side by side at full size.

    The number in each row comes from the file this page has just written. Move the slider and the rows are encoded again, so you can stop at the first setting where the photo still looks right to you.

    Converting a JPG does not undo its compression#

    A JPG has already thrown some detail away, and converting it cannot bring that back. AVIF encodes what is left, blocky patches and all, so start from the best copy you have. A heavily compressed JPG sometimes shrinks less than you would expect, because AVIF spends bytes keeping the artefacts it was given.

    Lossless is rarely worth it for a JPG. It keeps the decoded JPG exactly, blocky patches and all, and those are expensive to describe precisely. In testing, a 512 KB photo 1920 pixels wide became a 3.1 MB lossless AVIF, and a 215 KB one 500 pixels wide became 564 KB, against 128 KB and 59 KB lossy at 60%. Use it only when the pixels have to match the JPG exactly.

    Metadata does not come across. The AVIF is written from the pixels alone, so it carries no camera model, date, or GPS location. That suits a photo going on a website and is worth knowing if you needed those details kept.

    Why it takes longer than other converters#

    Every current browser can display AVIF, and none can write one, so this page carries the libavif encoder compiled to WebAssembly. That is a 3.5 MB file, about 1 MB as it travels compressed, fetched the first time you convert a photo rather than with the page. It runs in the background, so the page stays responsive while it works.

    Encoding AVIF is slow work by design: the encoder searches for the smallest way to describe each block of the picture. On a recent laptop a small photo takes a fraction of a second and a 12 megapixel one about three seconds, the first of them including the time to fetch the encoder. The timing under the list shows what your device actually took.

    Frequently asked questions#

    Are my photos uploaded anywhere?

    #

    No. The encoder is part of this page and runs on your device, so your photos never leave it. Once the encoder has loaded, the page keeps working with the network switched off.

    Should I use AVIF or WebP?

    #

    AVIF usually makes the smaller file at the same look, and WebP is quicker to make and opens in slightly more software. For photos on a website that you control, AVIF is the better choice. For something you are sending to other people, or uploading to a service you cannot check, JPG to WebP or keeping the JPG is safer.

    How do I use AVIF on a website and still support older browsers?

    #

    Serve both files. Put the AVIF in a picture element as a source with the type image/avif, and keep the JPG in the img tag inside it. A browser that reads AVIF takes the smaller file, and any other falls back to the JPG, so nobody sees a broken image.

    What quality should I use?

    #

    The slider starts at 60%, where a photo looks unchanged at normal size. Lower settings smooth away fine texture such as hair, grass, and fabric before anything else, so check those areas at full size. Going above about 80% makes the file much bigger for little you can see.

    When should I use lossless AVIF?

    #

    Hardly ever for a photo that starts as a JPG. Lossless keeps every pixel of the decoded JPG, compression artefacts included, so the AVIF is usually several times larger than the JPG it came from. It suits a copy that must decode to exactly the same pixels, such as a reference for a visual test. To keep a photo with nothing lost, keep the JPG; to make it smaller, stay on Lossy.

    Is the rotation of a phone photo kept?

    #

    Yes. The browser applies the orientation stored in the JPG when it reads it, and the AVIF is written the right way up, so it shows upright in any viewer.

    How do I turn an AVIF back into a JPG?

    #

    Use the AVIF to JPG converter. Browsers read AVIF natively, so that direction needs no extra download.