MarketExploreTry on
Pricing
Sign inStart
Field GuideMotion
Motion

GIF vs MP4 vs WebM: which format for loops

GIF is the format everyone knows and almost nobody should use for the web. It is also the only one that works in an inbox. Here is which to pick, where, and why.

GradientlyVerified Gradiently account·October 1, 2026·5 min read
Cover: July Postcard · GR·B43W·CT

The short version

  • For websites and social media, MP4 and WebM are usually much smaller than GIF for the same loop and show smooth colour.
  • GIF can show at most 256 colours in each frame, which makes gradients band or look speckled.
  • GIF remains the practical choice for animation in email, because most email clients don't play video.
  • WebM is often smaller than MP4, but MP4 plays almost everywhere, so websites commonly offer both.
  • Animated WebP and AVIF are modern image formats that replace GIF on websites, but they are not a safe choice for email.
On this page
What each format actually isWhy gradients look bad as GIFsMP4 or WebM for websitesLoops for social mediaLoops in email: still GIFConverting between GIF and MP4Which format to use, at a glance

GIF vs MP4 is decided by where the loop will play. On websites and social media, MP4 (and its open cousin WebM) is almost always the right choice: files are usually far smaller, colour is smooth and playback is efficient. GIF is still the right choice in one place, email, because most inboxes show animated GIFs and very few play video. Everything else in this guide is detail on that rule.

What each format actually is

GIF is an image format from the late 1980s that can hold several frames. It stores each frame with a palette of at most 256 colours and compresses each frame on its own terms. MP4 and WebM are video formats. They use modern video codecs, such as H.264 in MP4 and VP9 or AV1 in WebM, which store what changes between frames rather than every frame in full. For a loop where most of the picture changes slowly, that difference is enormous.

ColoursUp to 256 per frame

MP4

Millions

WebM

Millions
File size for a loop

GIF

Largest

MP4

Small

WebM

Often smallest
Transparency

GIF

On or off per pixel, no soft edges

MP4

No

WebM

Yes, in some browsers
SoundNo

MP4

Yes

WebM

Yes
WebsitesYes, as an image

MP4

Yes, as a video

WebM

Yes, in modern browsers
EmailMost clients

MP4

Rarely

WebM

Rarely
Social uploads

GIF

Varies by platform

MP4

Everywhere

WebM

Some platforms
FeatureGIFMP4WebM
ColoursUp to 256 per frameMillionsMillions
File size for a loopLargestSmallOften smallest
TransparencyOn or off per pixel, no soft edgesNoYes, in some browsers
SoundNoYesYes
WebsitesYes, as an imageYes, as a videoYes, in modern browsers
EmailMost clientsRarelyRarely
Social uploadsVaries by platformEverywhereSome platforms
The broad picture. Support for specific platforms and inboxes changes, so check the place you are publishing.

Why gradients look bad as GIFs

A smooth gradient across a 1080 pixel frame can use thousands of distinct colours. A GIF frame can hold 256 at most. The encoder has two choices: round colours to the nearest one in the palette, which produces visible stripes, or scatter pixels of neighbouring colours to fake the in-betweens, called dithering, which looks speckled and makes files bigger. Neither looks like the gradient you designed.

An exaggerated view of what a limited palette does to a gradient. Real GIFs have more steps, but on dark, subtle gradients the bands still show.

Grain helps a little, because noisy images hide palette limits better than clean ones. But the real fix is not to use GIF where video is possible. Gradient banding explains the same problem in still images.

MP4 or WebM for websites

For a website, replace GIFs with a video element that behaves like one: autoplaying, muted, looping and inline. web.dev's guide to replacing animated GIFs with video explains the approach. Offer WebM first, since it is often smaller, and MP4 as the fallback that plays almost everywhere.

html
<!-- Instead of <img src="loop.gif" alt=""> -->
<video autoplay muted loop playsinline width="600" height="600"
       poster="loop-poster.jpg">
  <source src="loop.webm" type="video/webm">
  <source src="loop.mp4" type="video/mp4">
</video>
A video that behaves like a GIF. Width and height stop the layout jumping as it loads.

Two other formats are worth knowing. Animated WebP and animated AVIF are image formats, used in an ordinary img tag like a GIF, but with full colour and much better compression. Modern browsers support both. They are handy where a CMS or platform only accepts images, but not for email. For full-width backgrounds, read video backgrounds on websites.

Loops for social media

Social platforms are built around video, and MP4 is the format they all accept. Where a platform takes a GIF upload, it often handles it differently from a normal video, so a GIF is rarely an advantage. Export your loop as MP4 at the platform's size, in H.264, and let the platform do the rest. Animated posts vs static covers sizes and settings.

Loops in email: still GIF

Most email clients don't play video, so an animated GIF is the practical way to put motion in an email. Keep it small and treat the first frame as the fallback: some clients, including some versions of classic Outlook for Windows, show only the first frame. Put the message in that frame so nothing is lost. Our guides to email header design and gradients in email cover the rest.

  1. 1

    Keep it short

    Two to six seconds is plenty in an email; every frame adds weight.

  2. 2

    Reduce the size and frame rate

    Export at the width it displays, often 600 pixels, and at a lower frame rate, such as 10 to 15 frames per second, for slow movement.

  3. 3

    Put the message in frame one

    Readers who only see the first frame should still get the point.

  4. 4

    Check the file size

    Large GIFs load slowly on phones. If it is heavy, cut length, size or colours before anything else.

Converting between GIF and MP4

ffmpeg, a free command-line tool, handles both directions. Turning video into a good GIF needs a custom palette built from the video itself; turning a GIF into MP4 is simpler.

bash
# MP4 to GIF: 15 fps, 600 px wide, with a palette made from the clip
ffmpeg -i loop.mp4 -vf "fps=15,scale=600:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse" -loop 0 loop.gif

# GIF to MP4: H.264, even dimensions, ready for the web
ffmpeg -i loop.gif -movflags +faststart -pix_fmt yuv420p \
  -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" loop.mp4

# MP4 to WebM (VP9)
ffmpeg -i loop.mp4 -c:v libvpx-vp9 -crf 34 -b:v 0 -an loop.webm
palettegen and paletteuse pick the 256 colours that suit this clip, which is the biggest single improvement to GIF quality.

Which format to use, at a glance

Website hero or background

Use

WebM with MP4 fallback

Why

Smallest files, smooth colour
Inline animation in an article

Use

MP4 video, or animated WebP

Why

Much lighter than GIF
Instagram, TikTok, LinkedIn, X

Use

MP4 (H.264)

Why

What platforms expect
EmailGIF

Why

The animation most inboxes show
Chat apps and stickers

Use

Whatever the app asks for

Why

Each app has its own rules
Where it playsUseWhy
Website hero or backgroundWebM with MP4 fallbackSmallest files, smooth colour
Inline animation in an articleMP4 video, or animated WebPMuch lighter than GIF
Instagram, TikTok, LinkedIn, XMP4 (H.264)What platforms expect
EmailGIFThe animation most inboxes show
Chat apps and stickersWhatever the app asks forEach app has its own rules

If you make loops in Gradiently, the Studio exports both: a video (MP4 where your browser can record it, otherwise WebM) up to 1080p, and a GIF with a choice of quality that is kept under 15 MB. Make sure the loop joins cleanly whichever you choose; see seamless loops.

Design with a living gradient

Posts, stories, slides and banners in every size, with text that always reads.

Start designing, free

Questions people ask

Is MP4 better than GIF?

For websites and social media, yes: MP4 files are usually far smaller and show smooth colour, while GIF is limited to 256 colours per frame. GIF is still the better choice for email.

Why do my gradient GIFs look striped?

GIF can hold at most 256 colours per frame, so smooth gradients are rounded into bands or dithered into speckles. Use video where you can, or build a custom palette when exporting.

Should I use WebM or MP4?

On websites, offer WebM first because it is often smaller, with MP4 as a fallback because it plays almost everywhere. For social uploads, use MP4.

Can I put a video in an email?

Very few email clients play video. Use an animated GIF, keep it small and make sure the first frame carries the message, since some clients show only that frame.

What is animated WebP?

It is an image format that can hold animation with full colour and better compression than GIF. Modern browsers support it, but email clients generally don't.

Share this guide

Written by GradientlyVerified Gradiently account

The team behind Gradiently, a design tool built around Marks: living gradients that make everything you design look like yours.

See our profile

On this page

What each format actually isWhy gradients look bad as GIFsMP4 or WebM for websitesLoops for social mediaLoops in email: still GIFConverting between GIF and MP4Which format to use, at a glance

Share this guide

Next in Motion

Reels background design for Reels and TikTok videos

Keep reading

All Motion guides
Motion

Seamless loop video: how to make one that never jumps

6 min read

A loop that jumps once every ten seconds is worse than no motion at all. The fix is not a better editor; it is motion designed to come home.

Motion

Video background website design: weight, autoplay and access

5 min read

A moving hero can make a site feel alive, or make it slow, distracting and hard to read. The difference is a short list of technical and design choices.

Gradients

Why your gradient has stripes, and how to fix banding

5 min read

You made a smooth gradient and it came back striped. That is banding, and it has a simple cause and a handful of reliable fixes. Here is the arithmetic, then the cures.

Find the look that’s only yours.

Every Mark is a living background with one owner. Try an unclaimed Mark, and claim yours when it feels right.

Start designingSee the launch offer

Marks left to claim

50of 1,000

950 claimed so farFind yours

Check a certificate

Type a certificate number or a Mark’s code to see who owns it.

Works with ChatGPT and Claude

Ask your AI for a design. It makes it in your Mark, ready to edit.

ChatGPTClaude
How to connect

Product

  • Market
  • Explore
  • Pricing
  • Launch packs
  • Certificates

Learn

  • Field Guide
  • Help centre
  • What’s new

Developers

  • Overview
  • ChatGPT and Claude
  • API reference
  • API keys

Company

  • About
  • Contact us
  • Sign in

Legal

  • Terms
  • Privacy
  • Refunds
  • Mark protection
  • Cookies
  • All policies
Move through the letters. Each one wears a real Mark.Touch a letter to see its Mark.One name. Ten Marks inside it.
© 2026 Gradiently