Convert WebM to MP4 — Free Online Tool

Convert WebM files to MP4 by re-encoding VP9 video to H.264 (libx264) and Opus audio to AAC — making your web-optimized video universally playable on devices, platforms, and media players that don't support WebM natively. The output MP4 is optimized for streaming with the <code>+faststart</code> flag.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

WebM uses VP9 video and Opus audio codecs, which are excellent for browser-based streaming but poorly supported outside of Chrome, Firefox, and a handful of modern apps. Because MP4's default codec (H.264/libx264) is fundamentally different from VP9, the video stream must be fully re-encoded — not simply remuxed — which means FFmpeg decodes every frame and re-compresses it using x264. The Opus audio track is similarly transcoded to AAC, the standard audio codec for MP4. The <code>-movflags +faststart</code> flag relocates the MP4 metadata (the 'moov' atom) to the beginning of the file, which allows the video to begin playing before it has fully downloaded — critical for web delivery.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg program, the open-source multimedia processing engine that handles all decoding, re-encoding, and muxing in this WebM-to-MP4 conversion.
-i input.webm Specifies the input WebM file. FFmpeg reads the VP9 video stream and Opus (or Vorbis) audio stream from this container for decoding.
-c:v libx264 Sets the video encoder to libx264, which re-encodes the VP9 video frames from the WebM into H.264 — the codec required for broad MP4 compatibility across browsers, devices, and platforms that don't support VP9.
-c:a aac Transcodes the Opus (or Vorbis) audio from the WebM into AAC, the standard audio codec for MP4 files and the format expected by Apple devices, social media platforms, and most hardware media players.
-crf 23 Sets the Constant Rate Factor for the x264 encoder to 23, which is the libx264 default and produces a good balance of visual quality and file size. Lower values (e.g., 18) increase quality and file size; higher values (e.g., 28) reduce both.
-b:a 128k Sets the AAC audio bitrate to 128 kilobits per second, which is the standard bitrate for transparent-quality stereo AAC audio and is well-suited for speech, music, and general-purpose video content converted from WebM.
-movflags +faststart Moves the MP4 moov atom (the file's metadata index) to the beginning of the file after encoding completes. This is a WebM-to-MP4 best practice that enables the video to start playing in a browser or media player before the entire file has been downloaded.
output.mp4 The name of the resulting MP4 file. FFmpeg infers the output container format from the .mp4 extension and muxes the newly encoded H.264 video and AAC audio streams into it.

Common Use Cases

  • Sharing a screen recording exported from a browser-based tool (like Loom or a Chrome extension) that outputs WebM, so it can be viewed on iPhones, Windows Media Player, or uploaded to Instagram and TikTok
  • Uploading a WebM gameplay capture or tutorial to YouTube, which accepts MP4/H.264 far more reliably and with faster processing than VP9 WebM uploads
  • Converting a WebM video downloaded from a website or saved by a browser to an MP4 that can be embedded in a PowerPoint or Keynote presentation
  • Preparing a WebM animation or explainer video for use in a video editor like Adobe Premiere Pro or Final Cut Pro, which have limited or no native VP9 support
  • Sending a WebM video via messaging apps or email clients that strip or reject WebM attachments but handle MP4 without issue
  • Converting WebM files produced by WebRTC-based video conferencing recordings to MP4 for archiving, transcription services, or playback on media servers

Frequently Asked Questions

Yes, some quality loss is unavoidable because this conversion requires re-encoding the VP9 video stream into H.264 — two different codecs — which is a lossy process even at high quality settings. VP9 is also generally more efficient than H.264, meaning an H.264 file at the same visual quality will typically be larger. The default CRF of 23 in this tool strikes a good balance between quality and file size for most content, but you can lower the CRF value (toward 0) in the FFmpeg command for higher fidelity if file size is not a concern.
VP9 (WebM's default video codec) is a newer, more efficient codec than H.264 (MP4's default). VP9 can achieve the same visual quality as H.264 at roughly 30-50% lower bitrate, so converting from VP9 to H.264 at comparable quality settings will almost always produce a larger file. This is a known codec efficiency difference, not a flaw in the conversion. If file size is a priority, consider using H.265 (libx265) as the video codec in the FFmpeg command instead, though H.265 has slower encoding times.
Subtitles and chapters are not carried over in this default conversion command. Both WebM and MP4 support subtitles and chapters, but the FFmpeg command shown does not include stream mapping flags for subtitle or chapter tracks. To preserve them, you would need to add <code>-c:s mov_text</code> for subtitles and ensure chapter metadata is mapped explicitly. Note that WebM subtitle formats (typically WebVTT) may need to be re-encoded to a format compatible with MP4 containers.
No. WebM with VP9 supports an alpha channel for video transparency, but MP4 with H.264 does not support video transparency. During this conversion, the alpha channel will be discarded and replaced with a solid black or white background depending on how FFmpeg composites it. If transparency is essential to your workflow, you should consider keeping the WebM format or converting to a format that supports alpha video, such as MOV with ProRes 4444.
To change video quality, modify the <code>-crf</code> value: lower numbers (e.g., <code>-crf 18</code>) produce higher quality and larger files, while higher numbers (e.g., <code>-crf 28</code>) produce smaller files with more compression. For audio, change the <code>-b:a</code> value — for example, <code>-b:a 192k</code> for higher-quality AAC audio or <code>-b:a 96k</code> to reduce file size. CRF values for libx264 range from 0 (lossless) to 51 (worst quality), with 18–28 being the practical range for most video content.
Yes. On Linux or macOS, you can run a shell loop: <code>for f in *.webm; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k -movflags +faststart "${f%.webm}.mp4"; done</code>. On Windows Command Prompt, use: <code>for %f in (*.webm) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k -movflags +faststart "%~nf.mp4"</code>. Batch processing is particularly useful for converting multiple browser-recorded WebM files from a single session, and is best done on desktop FFmpeg for large or numerous files beyond the 1GB browser limit.

Technical Notes

This conversion involves a full transcode of both the video and audio streams — no stream copying is possible because VP9 (WebM) and H.264 (MP4) are incompatible codecs. The x264 encoder used here is the industry-standard H.264 implementation and produces output compatible with virtually every device, platform, and media player manufactured in the last 15 years. The <code>-b:v 0</code> flag is intentionally omitted here (it is VP9-specific for enabling pure CRF mode) since x264 operates in CRF mode by default without it. The <code>-movflags +faststart</code> flag performs a post-encoding pass to move the MP4 moov atom to the front of the file, which is essential if the output will be served via HTTP progressive download or embedded on a web page. One important limitation: if the source WebM was encoded with HDR metadata (HDR10 or HLG via VP9), that HDR metadata will be lost in the H.264 output since libx264 does not support HDR; you would need libx265 with appropriate HDR flags for an HDR-preserving output. Multiple audio tracks from the WebM source are not mapped by default — only the first audio stream is transcoded to AAC.

Related Tools