How to Embed a Video on a Website (Any Platform)
The three ways to put video on a website
YouTube / Vimeo embed
Best for
Watch out for
HTML5 <video> tag
Best for
Watch out for
Video gallery widget
Best for
Watch out for
Method 1: embed a YouTube or Vimeo video
Open the video, click Share → Embed, copy the iframe and paste it into an HTML or embed block on your site. To make it responsive, wrap it in a container with aspect-ratio: 16 / 9. Our free YouTube embed code generator and Vimeo embed generator do this for you and add options like autoplay and loop.
Method 2: host the file and use the video tag
For short clips — a hero loop, a product spin — upload an MP4 (H.264 video, AAC audio) to your hosting or CDN and use the HTML5 video element. Add controls, a poster image and preload="metadata" so the page stays fast. Our HTML video tag guide covers every attribute.
Method 3: add a video gallery
When you have more than one video — a channel, a playlist, testimonials, Shorts and Reels — embedding them one by one gets messy. A video gallery widget pulls them from their source, keeps them up to date and shows them in a grid, carousel or player with playlist.
Step-by-step for your platform
Make embedded video fast
Lazy-load videos below the fold.
Use a poster image instead of loading the player immediately.
Keep autoplaying clips short, muted and compressed.
Don’t host long videos on your own server — use YouTube, Vimeo or a video CDN.
On this page
