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

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

Updated September 2026 · 10 min read

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

YouTube / Vimeo embed

Best for

One video, free hosting

Watch out for

Related videos, branding, one video per embed

HTML5 <video> tag

Best for

Short clips you host yourself

Watch out for

Bandwidth, formats, no gallery

Video gallery widget

Best for

Several videos, feeds, mixed sources

Watch out for

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.

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

Related

How to optimize & compress video for website

Use MP4 (H.264/AAC), keep resolution at 1080p or less, compress to a sensible bitrate, add a poster image and lazy-load videos below the fold.How to optimize & compress video for website