fileformer
search⌘KtranslateENexpand_moreupload_fileConvert
Converters8 file families · 44 direct conversions
What changes in a conversionarrow_forward
home/video/gif-to-mp4

The same loop as a video: usually far smaller, never limited to 256 colours.

A GIF is a stack of separate pictures; an MP4 stores only what changes between frames. This page decodes your GIF frame by frame, resamples its uneven delays to a steady frame rate, fills transparency, and encodes H.264 with your browser's own encoder into an MP4 it writes itself. Then it plays the result and compares it with the GIF.

animationFlat cartoongradientDithered gradientscreen_recordScreen recording
error
GIF · 7.7 KB · 20 frames
MP4 · encoding…
GIF delays (top) resampled to 30 fps (bottom)1.60 s · GIF delays from 50 to 600 ms · 1 delay(s) of 0-1 cs played as 100 ms, as browsers do · each video frame shows the GIF frame on screen at that moment
frame rate
15 fps25 fps30 fps
transparent areas become
whiteblackpage grey
size
original2× (pixel-sharp)3×
hourglass_topEncoding frame 33 of 48…
GIF200×150 · 20 frames · 7.7 KB
MP4…
codec…
file check…
plays here…
quality vs GIF…
odd size fixednot needed
Encoding frame 33 of 48…downloadEncoding…
~/colours-in-colours-out

The video isn't limited to 256 colours, but it stores colour at half resolution.

GIF picks up to 256 exact colours per frame. H.264 stores brightness for every pixel but colour for each 2 × 2 block (4:2:0), and rounds everything a little. Gradients get smoother, while thin coloured lines and pixel art soften. This compares the same frame from the GIF and from the MP4 your browser just decoded, at 4×.

Encode a GIF above…
GIF frame, 4×
MP4 frame, 4×
~/where-gif-still-wins

Where you should keep the GIF

MP4 is the better file almost everywhere a video tag or a social upload works. These are the cases where it isn't, checked against what this page measured.

mailEmail newslettersMost email clients block video; GIF is the only animation that plays inline.not measurable here
chatChat apps that only take imagesSome forums, comment boxes and older chat tools accept images but not video uploads.depends on the site
photo_size_select_smallTiny, flat animationsIcons, loaders and pixel art under ~20 KB: GIF’s LZW can beat a video’s keyframes.…
opacityTransparencyH.264 has no alpha channel, so see-through areas are filled. Use WebP or APNG to keep them.this GIF is fully opaque
grid_onExact pixel artColour is stored at half resolution and slightly rounded, so hard pixel edges soften.…
all_inclusiveA loop count of its ownGIF carries "loop 3 times" inside the file; MP4 relies on the page or app to loop.this GIF: loops forever
~/make-it-behave-like-a-gif

Make the MP4 behave like a GIF on your page.

A GIF autoplays and loops on its own. A video does the same with four attributes: autoplay, loop, muted (browsers only autoplay silent video) and playsinline (otherwise iPhones go full-screen). The MP4 next to the GIF above is playing with exactly this markup. The GIF's own loop count can't be carried: MP4 has no loop field, so looping is the page's job.

<video src="bounce.mp4" autoplay loop muted playsinline width="200" height="150" aria-label="bounce animation"></video>
Add preload="none" and a poster image for large clips below the fold. If you must offer the GIF too, put it in the fallback: <video …><img src="bounce.gif" alt=""></video>.
~/other-routes

Other ways out of a GIF.