NEWMeet the new Video Gallery — YouTube, TikTok, Instagram Reels, Vimeo and Twitch in one widget.

Find a widget for you

You can use our widgets to accomplish practically any task on your website — increase users' confidence, grow conversion, engage your visitors, provide support, etc.

See All Widgets
GuideVideo Gallery

How to Embed a Video on a Website (Any Platform)

Updated September 2026 · 10 min read

Short answer

Upload the video to YouTube or Vimeo and paste its embed code, use the HTML5 video tag for files you host yourself, or use a video gallery widget when you need several videos. Here’s how each method works and when to use it.

The three ways to put video on a website

MethodBest forWatch out for
YouTube / Vimeo embedOne video, free hostingRelated videos, branding, one video per embed
HTML5 <video> tagShort clips you host yourselfBandwidth, formats, no gallery
Video gallery widgetSeveral videos, feeds, mixed sourcesPick 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.

The no-code way

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.

More in How to optimize video for your website.

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%.

Related

Put your videos on your website

Create a free video gallery in minutes.

Create Widget for Free