GIF to MP4 & WebM

Developer tools

Replace that GIF with a tenth of the bytes

Animated GIFs are the heaviest thing on most pages. Convert them to MP4 or WebM and paste the <video> tag that plays exactly like a GIF.

Drop an animated GIF or browseConverted in your browser with WebCodecs — nothing uploaded
Make

About this tool

The biggest page-weight win on most sites

GIF compresses each frame on its own with a 1980s algorithm, so a few seconds of animation is often several megabytes. Modern video codecs store only what changes between frames and are typically 80–95% smaller for the same animation. This decodes the GIF frame by frame in your browser, encodes it with your device’s own H.264 or VP9 encoder, keeps the original timing, and writes the muted, looping, autoplaying <video> markup that behaves like a GIF — Lighthouse’s “use video formats for animated content” fixed in one step.

  • Free, no sign-up
  • Runs in your browser
  • Nothing uploaded

Frame-accurate timing

Each frame keeps its own delay from the GIF, so the animation plays at exactly the original speed.

Hardware encoding

WebCodecs uses your device’s video encoder — the same engine as the video compressor — so even long GIFs convert in seconds.

Drop-in markup

autoplay, loop, muted and playsinline, with the MP4 and WebM sources and a poster — it plays like the GIF did.

Step by step

How to convert a GIF to MP4

  1. Add your GIF

    Drop one or several animated GIFs.

  2. Pick the format

    MP4 (H.264) plays everywhere; WebM (VP9) is often smaller. Make both for the best of each.

  3. Download and paste

    Download the video and replace the <img> with the <video> markup shown.

Get the most out of it

Tips for the best results

  • Make both formatsList WebM first and MP4 second; browsers take the first they can play.
  • Keep it mutedBrowsers only autoplay muted video. The markup includes muted and playsinline for iPhones.
  • Add a posterA poster image shows instantly while the video loads — the tool generates one from the first frame.
  • Check the resultPlay the converted file next to the original before you swap it in.

Questions

Questions about this tool

Everything here runs in your browser — nothing you add is uploaded. More in the general FAQ.

Why convert GIF to MP4?

Size. GIF is an inefficient format for animation; the same clip as MP4 or WebM is usually 80–95% smaller, which loads faster and improves Core Web Vitals. Lighthouse flags large GIFs for exactly this reason.

Will the video autoplay and loop like a GIF?

Yes, with the markup provided: <video autoplay loop muted playsinline>. Browsers allow muted video to autoplay, and playsinline stops iPhones going full screen.

MP4 or WebM?

MP4 with H.264 plays in every browser. WebM with VP9 is often smaller but not supported by every encoder or older Safari. The markup lists both so each browser picks the best one it can play.

Is transparency kept?

No — MP4 and WebM from this tool are opaque, and transparent GIF pixels are filled with a background colour you choose. For transparent animation, keep the GIF or use animated WebP.

Is my GIF uploaded?

No. Decoding and encoding happen in your browser using WebCodecs.