Market
Pricing
Sign inStart
Field GuideMotion
Motion

MP4 vs WebM: which video format to export

Two containers, a handful of codecs and one practical question: which file do you hand to Instagram, and which do you put on your website.

GradientlyVerified Gradiently account·October 1, 2026·5 min read
Cover: Azure Sonnet · GR·SRZE·SD

The short version

  • MP4 is the safest video format to export because it plays on almost every phone, browser, editor and social platform.
  • WebM is an open, royalty free format that is often smaller than MP4 at similar quality, which makes it useful on websites.
  • For social media uploads, export MP4, because platforms reliably accept it and re-encode everything anyway.
  • On a website, a common pattern is to offer WebM first and MP4 as a fallback inside one video element.
  • WebM can carry transparency in browsers that support it, which ordinary MP4 with H.264 cannot.
On this page
What MP4 and WebM actually areWhich format for social mediaWhich format for a websiteConverting between MP4 and WebMGradients, banding and qualityWhere GIF fits in

In the MP4 vs WebM choice, export MP4 when you are uploading anywhere you don't control, such as Instagram, TikTok, LinkedIn, a client's inbox or a video editor, because it plays almost everywhere. Choose WebM for your own website, where it is often smaller at the same quality, and ideally offer both so each browser picks the one it plays best. That covers most decisions. The rest of this page explains why, and the few cases where the answer changes.

What MP4 and WebM actually are

Both are containers: boxes that hold a video stream, an audio stream and some information about them. What decides quality and size is the codec inside. MP4 usually carries H.264 video and AAC audio, sometimes H.265 or AV1. WebM carries VP8, VP9 or AV1 video with Opus or Vorbis audio. WebM was created as an open, royalty free format for the web; MP4 is the long established standard that cameras, phones and editing software were built around.

Usual video codecs

MP4

H.264, H.265, AV1

WebM

VP8, VP9, AV1
Usual audio codecs

MP4

AAC

WebM

Opus, Vorbis
File size

MP4

Small

WebM

Often smaller at similar quality
Plays onAlmost everything

WebM

Modern browsers; patchier in apps and editors
Social uploads

MP4

Accepted everywhere

WebM

Not reliably accepted
Transparency

MP4

Not with H.264

WebM

Yes, with VP9 in supporting browsers
Licensing

MP4

Some codecs carry patent licensing

WebM

Open and royalty free
FeatureMP4WebM
Usual video codecsH.264, H.265, AV1VP8, VP9, AV1
Usual audio codecsAACOpus, Vorbis
File sizeSmallOften smaller at similar quality
Plays onAlmost everythingModern browsers; patchier in apps and editors
Social uploadsAccepted everywhereNot reliably accepted
TransparencyNot with H.264Yes, with VP9 in supporting browsers
LicensingSome codecs carry patent licensingOpen and royalty free
The broad picture. Support shifts over time, so check current browser support on caniuse before relying on an edge case.

Which format for social media

Export MP4. Every major platform accepts it, and every platform re-encodes what you upload, so a smaller WebM gains you nothing once it is there. The things that actually change how your video looks after upload are the frame size, the frame rate and the quality of the file you send. Send a clean 1080×1920 MP4 for Reels and stories, or 1080×1350 for a portrait feed post, and the platform has nothing to rescale.

Reel, story, TikTok 9:16

1080 × 1920

Portrait post 4:5

1080 × 1350

Square post 1:1

1080 × 1080

Landscape 16:9

1920 × 1080

The frames you will export most often. Every one of them should go up as MP4.

For the full list of frames by platform, see social media video sizes.

Which format for a website

On your own site you control the player, so you can offer both. The browser reads the source elements in order and plays the first one it supports. Put WebM first if your WebM file is the smaller of the two, and keep MP4 as the fallback for any browser that can't play it.

html
<video autoplay muted loop playsinline
       width="1920" height="1080" poster="loop-poster.jpg">
  <source src="loop.webm" type="video/webm">
  <source src="loop.mp4" type="video/mp4">
</video>
WebM first, MP4 as the fallback. The poster shows while the video loads and for anyone whose browser can't play either.

Measure before you assume. For some clips, especially very short or very simple ones, a well encoded MP4 is as small as the WebM, and serving one file is simpler. MDN's guide to web video codecs is the reference for what each browser plays. If the clip is a background, video backgrounds on websites covers poster images, sizing and performance.

Converting between MP4 and WebM

If you have one format and need the other, the free command line tool FFmpeg handles both directions. The commands below are sensible starting points for designed loops: no audio, good quality, and an MP4 that starts playing before it has fully downloaded.

bash
# WebM to MP4 (H.264), ready for social uploads and the web
ffmpeg -i loop.webm -c:v libx264 -crf 20 -preset slow \
  -pix_fmt yuv420p -movflags +faststart -an loop.mp4

# MP4 to WebM (VP9), usually smaller for your website
ffmpeg -i loop.mp4 -c:v libvpx-vp9 -crf 32 -b:v 0 -an loop.webm
Lower CRF means higher quality and bigger files. Remove -an if the video has sound you want to keep.

Why yuv420p matters

Some encoders produce MP4 files in a colour format that phones and browsers refuse to play. Setting yuv420p keeps the file in the format everything understands.

Gradients, banding and quality

Soft gradients are the hardest thing to compress. Large areas of slowly changing colour expose any shortage of bits as visible steps, and dark gradients show it first. Both formats handle this well at a generous quality setting; neither does at a stingy one. A touch of grain in the design helps a lot, because encoders preserve texture rather than flattening it into bands.

An exaggerated view of banding. The fix is the same in MP4 and WebM: more quality, a little grain, and no extra rescaling.

The causes and fixes for still images are in gradient banding. The animated version adds one more rule: export at the exact size you will publish, so nothing gets scaled twice.

Where GIF fits in

GIF is not a video format and is the largest of the three for the same loop, with a 256 colour limit that bands gradients. Its one stronghold is email, where most inboxes show GIFs and very few play video. The three way comparison is in GIF vs MP4, and the craft of making a good one is in animated GIFs.

Export MP4 for

  • Instagram, TikTok, LinkedIn, X, YouTube
  • Sending to a client or an editor
  • Presentations and screens you don't control
  • Any time you are unsure

Export WebM for

  • Your own website, alongside an MP4
  • Overlays that need transparency in the browser
  • Pages where every kilobyte counts
  • Browser based tools that record WebM natively

In Gradiently, video exports are a Pro feature and come out as MP4 or WebM, depending on what your browser can record. Either way you get the moving Mark behind your words at up to 1080p, ready to upload or embed. The details are in export images and 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 WebM better than MP4?

WebM is often smaller at similar quality and is open and royalty free, but MP4 plays on far more devices and apps. For websites WebM is a good first choice with MP4 as a fallback; for everything else MP4 is safer.

Can I upload WebM to Instagram or TikTok?

Don't rely on it. Convert to MP4 first, which every platform accepts, at the exact frame size of the format you are posting.

Does Safari play WebM?

Recent versions of Safari play WebM, but support arrived later than in other browsers and has varied by codec and device. Offering an MP4 fallback avoids the question.

Which is smaller, MP4 or WebM?

WebM with VP9 or AV1 is often smaller than MP4 with H.264 at similar quality, but not always. Encode both and compare the actual files.

Which format supports transparent video?

WebM with VP9 can carry an alpha channel that supporting browsers display. Standard MP4 with H.264 cannot.

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 MP4 and WebM actually areWhich format for social mediaWhich format for a websiteConverting between MP4 and WebMGradients, banding and qualityWhere GIF fits in

Share this guide

Next in Motion

Animated GIFs: make them small, smooth and on brand

Keep reading

All Motion guides
Motion

GIF vs MP4 vs WebM: which format for loops

5 min read

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.

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.

Using Gradiently

How to export designs as images, PDFs and looping videos

6 min read

One Export button, six formats. Here is which one to choose for each job, and how to make a looping video that nobody can see the seam in.

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 designing

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
  • 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