Convert GIF to AVIF

Converting GIF to AVIF re-encodes a legacy still with a modern codec, and on flat artwork it is a large saving. On a dithered GIF it can be a loss, for a reason worth understanding before you run the batch. The encoding happens in your browser, with nothing uploaded.

  • Where it runs In your browser. The file is never uploaded.
  • Lossy Some detail is traded for size. AVIF cannot hold everything a GIF can.
  • File size limit Up to 100 MB per file, free, without an account.
  • Worth knowing Only the first frame is converted; an animated GIF becomes a still image.

Up to 100 files at once. Mixed formats are fine.

What GIF to AVIF actually does

A generated landscape with a low sun and three ridges, used to show what JPEG does to continuous tone. Shown as GIF.

GIF36 KB

A generated landscape with a low sun and three ridges, used to show what JPEG does to continuous tone. Shown as AVIF.

AVIF17 KB2.1× smaller

A photographic scene — smooth gradients, soft edges, grain. This is the case AVIF is designed for or against, and the figures show which. Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.
A generated badge: a circular gradient on a transparent background with a white bar across it, used to show what each format does with transparency and with hundreds of shades. Shown as GIF.

GIF8 KB

A generated badge: a circular gradient on a transparent background with a white bar across it, used to show what each format does with transparency and with hundreds of shades. Shown as AVIF.

AVIF3 KB2.2× smaller

A transparent background and a gradient across the shape. AVIF either keeps both, keeps one, or fills the transparency with a solid colour — which is the difference that catches people out. Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.
A generated application window with a sidebar, a table and a bar chart, used to show what JPEG does to flat colour and hard edges. Shown as GIF.

GIF6 KB

A generated application window with a sidebar, a table and a bar chart, used to show what JPEG does to flat colour and hard edges. Shown as AVIF.

AVIF5 KB20% smaller

Flat colour and hard edges, as in an interface, a chart or a logo. Very different behaviour from the photograph above, and the reason the answer is "it depends what is in the file". Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.

What is actually inside the GIF before AVIF sees it

A GIF frame is a grid of indices into a palette that holds at most 256 entries, compressed with LZW. It has no continuous tone in it at all. Whatever photograph, gradient or soft shadow the image began as was mapped onto those 256 values at the moment the GIF was written, and the mapping is not reversible.

This matters because AVIF’s reputation was earned on photographs, where it routinely beats JPEG by a wide margin at the same visible quality. A GIF is not a photograph in the relevant sense even when it depicts one, and the numbers people quote for AVIF do not transfer to this source. What is achievable here is bounded by what the GIF kept.

Dithering is the reason some GIFs get bigger

To fake the colours it does not have, a GIF encoder scatters pixels of two available colours in an alternating pattern — Floyd–Steinberg dithering, usually — so that the eye averages them into a third. At normal viewing size it works. At the pixel level it is a field of high-frequency noise.

Every modern image codec, AVIF included, works by predicting each block from what came before it and storing only the error. A dither pattern is precisely the thing that cannot be predicted, so the encoder is forced to spend real bytes recording it. The result is the counterintuitive outcome people report: an AVIF larger than the GIF it came from, on an image with six visible colours in it.

Choosing a quality number for a source with 256 colours

The quality control runs from 1 to 100 and defaults to 82, which is a sensible starting point for photographs and a conservative one here. A source with 256 colours has less to protect, and dropping to 60 or 65 on a converted GIF is usually indistinguishable from the original while removing most of the dither penalty.

The test that settles it is the byte count rather than an opinion. Convert once at the default, once lower, and compare the result against the GIF; if the AVIF is not comfortably smaller, the source is dithered and the quality number is the lever. On genuinely flat artwork — a logo, a diagram, an interface screenshot without gradients — even low settings hold up, because there is nothing subtle to damage.

AVIF needs a fallback and the GIF was the fallback

The format’s browser support is recorded here as modern rather than universal, which is a meaningful distinction on a site with real traffic: current browsers read AVIF, and there is a tail that does not. A GIF, whatever else is wrong with it, is read by everything ever built.

So replacing the GIF outright is a regression for that tail, and the picture element exists for exactly this. List the AVIF as the first source, a PNG or WebP as the second, and leave an image element inside as the base case. The browser takes the first thing it understands and nobody sees a broken image — and it is worth checking the fallback actually renders, because the failure is invisible on the machine you built it on.

Only the first frame crosses over, though AVIF can animate

AVIF supports animation — the format record says so, and animated AVIF files exist. This conversion does not produce one. The decoder hands over a single picture and a single image is encoded, so an animated GIF becomes the frame it opens on.

That is the correct behaviour for the job this page is for, which is stills. If the GIF you are optimising does animate, converting it to AVIF is not where the saving is: a video container with real motion compensation will be a fraction of the size of any per-frame image format, animated AVIF included, and the video route is the one to take.

Twelve bits of colour depth, and nothing to fill them with

AVIF stores up to 12 bits per channel and can carry wide-gamut colour. Those capabilities are why it is a good archival and delivery format for photographs taken on modern equipment.

None of it applies to a GIF. The source has 8-bit indexed colour drawn from a table of 256 entries, and encoding it into a container that could have held far more does not create additional colours — it stores the same handful with room to spare. Nothing is lost either, which is the point worth taking away: the conversion is neutral on colour and the question is only about bytes.

The encoder is slow, and that changes how you run a batch

AVIF’s known problem in this registry is encoding speed, and it is not a small effect. AV1 was designed with a large search space and the still-image encoder uses it; a single moderate image takes noticeably longer than the same image as WebP or JPEG, and it is doing that work on your own processor rather than on a server farm.

For a folder of legacy graphics that is still the right trade, because the cost is paid once and the saving is paid on every page load. But plan for it: a batch of two hundred old GIFs is a coffee break rather than a click, and running it on the machine that is also serving your development environment will make both feel slow.

Where WebP is the better target for the same file

AVIF is not automatically the right answer for a legacy GIF. WebP encodes far faster, is supported by a wider set of browsers, and on small flat graphics — which is what most surviving GIFs are — the file size difference between the two is often a few hundred bytes.

The rough division: AVIF where the image is large and photographic and the saving is measured in tens of kilobytes; WebP where the image is a small interface graphic and the win is compatibility and encode time. Where the GIF is a hard-edged logo with a handful of colours, PNG frequently beats both, because lossless compression of flat colour is what PNG was built for.

The pictures stay on the machine you run this on

The AV1 encoder is a WebAssembly module downloaded the first time this pair is used and then run locally. The image is decoded and re-encoded inside the tab, so no part of it reaches a server, there is no account, and there is no per-file limit beyond the 100 MB free ceiling.

Running a whole folder works the same way and returns the results together. Because the work is local, the batch is bounded by your own processor rather than by a queue, which is the trade that makes a slow encoder acceptable.

How to convert a GIF into an AVIF

  1. Drop the GIF onto this page, or click to choose it.
  2. Lower the quality below the default if the GIF is dithered, then convert.
  3. Compare the AVIF against the original, and keep whichever is smaller.

GIF and AVIF: 1987 indexing against an AV1 still

GIF compared with AVIF
GIFAVIF
Full nameGraphics Interchange FormatAV1 Image File Format
File extension.gif.avif
Media typeimage/gifimage/avif
CompressionLossless — nothing is discardedEither, depending on the setting
First published19872019
Published byCompuServeAlliance for Open Media
SpecificationGIF89aAV1 Image File Format
LicensingOpen standardOpen standard
Standing todayLegacy, still read everywhereCurrent
Bit depth812
Colour it can describeindexed paletteRGB, YCbCr, wide gamut
Largest image65,535 px per side65,536 px per side
Opens in a browserEvery browserCurrent browsers
Considered insteadWebP, MP4WebP, JXL, JPG

What survives

Transparency survives. Both GIF and AVIF store an alpha channel, so a cut-out stays cut out and nothing is filled in behind it.

Animation survives. GIF and AVIF both hold multiple frames, so the result moves rather than freezing on the first one.

Opening the result

Current browsers read AVIF; older ones do not. It is the less portable of the two, so it is worth being sure the program at the other end accepts it before sending one.

AVIF is a container rather than a single format. What actually plays is the codec inside it — usually AV1 — which is why two files with the same extension can behave differently on the same device.

GIF dates from 1987 and is largely superseded. AVIF is what current software writes, so the conversion is as much about staying readable as about the file itself.

GIMP and ImageMagick read both GIF and AVIF, so there is a way to check the result against the original without a second tool.

What each format is for

GIF is CompuServe's format, published in 1987. It records 8 bits per channel.

AVIF comes from Alliance for Open Media and dates from 2019, specified as AV1 Image File Format. GIMP, Squoosh and ImageMagick all read it.

GIF was published in 1987 and AVIF in 2019. The older one is generally the safer file to hand to somebody; the newer one usually does the job in fewer bytes.

GIF to AVIF: quality, dithering and fallbacks

Why did my AVIF come out larger than the GIF?

Almost always dithering. A GIF with only 256 colours fakes gradients by scattering pixels of two colours in a checkerboard, and that pattern is high-frequency noise. AVIF finds its savings by predicting a pixel from its neighbours, which a dither pattern defeats by design, so the encoder spends bytes reproducing the noise. Lowering the quality setting fixes it, at the cost of blurring the dither.

What quality should I use for a GIF source?

Lower than you would for a photograph. The default is 82, which is tuned for camera images with real detail to protect; a 256-colour source has far less information in it and tolerates 60 to 70 without a visible difference. On flat artwork with no dithering at all, even lower is usually invisible.

Do I still need the GIF for older browsers?

You need something. AVIF is supported by current browsers and not by every browser in use, so serving it alone means some visitors see nothing. A picture element with the AVIF first and a PNG or WebP after it is the standard arrangement and costs two lines of markup.

Will an animated GIF become an animated AVIF?

No. AVIF can hold animation, but this conversion decodes a single frame and encodes a single image, so an animated GIF becomes its first frame. For animation the video route is the one that pays off — a GIF converted to MP4 or WebM is typically a small fraction of the original.

Is transparency preserved?

Yes. AVIF carries an alpha channel and nothing on this path flattens it, so a GIF’s transparent background comes through. AVIF’s alpha is also a full range rather than the single on-or-off transparent colour GIF allows, though it can only store what the GIF actually had — which is the hard-edged version.

Where does the conversion run?

In your browser. The AV1 encoder is fetched as a WebAssembly module the first time it is needed and then runs locally, so the image itself is never sent anywhere and there is no account.

More about these formats

Where these figures come from

The claims this page makes about GIF and AVIF are checkable, and these are the documents that settle them.