The three ways to put video on a website
| Method | Best for | Watch out for |
|---|---|---|
| YouTube / Vimeo embed | One video, free hosting | Related videos, branding, one video per embed |
| HTML5 <video> tag | Short clips you host yourself | Bandwidth, formats, no gallery |
| Video gallery widget | Several videos, feeds, mixed sources | Pick one that doesn’t slow the page |
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.
Connect YouTube, Vimeo, TikTok, Instagram Reels, Twitch or hosted videos, pick a layout and paste one code.
Try Elfsight Video Gallery →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.
Frequently asked questions
How do I put a video on my website?
To put a video on your website, embed it from YouTube or Vimeo, use the HTML5 video tag for your own files, or add a video gallery for several videos.
What is the easiest way to embed a video on a website?
Upload it to YouTube or Vimeo, copy the embed code and paste it into an HTML block. For several videos, use a video gallery widget.
How do I embed a video in HTML?
Use an iframe from YouTube or Vimeo, or the <video> tag with a src pointing to an MP4 file.
Should I upload videos to my own website?
Only short clips. Long videos use a lot of bandwidth; YouTube, Vimeo or a video CDN streams them better.
How do I make an embedded video responsive?
Wrap the iframe or video in a container with aspect-ratio: 16 / 9 and width: 100%.