Video File Formats for Websites: MP4, WebM and More

A video file extension usually identifies the container. The codec inside it affects whether a device can decode the video and how large the file needs to be.

Separate the container from the codec

MP4 and WebM are examples of containers. H.264 and VP9 are examples of codecs. When you choose an export preset, check both rather than judging it by the extension alone. Audio can have its own codec and compatibility requirements.

Create an export that suits the player

Start from a high-quality master, then compare smaller exports at the displayed size. Use formats supported by the target browsers and supply an alternative source where the audience needs it. Export captions separately when the player supports them.

Test the files where people will watch

Try the final video in a browser on a phone and a desktop, including on a slower connection. Check the sound, captions and seek controls. Our Manchester web design team can help integrate and test the player.

Read MDN’s guide to video containers