Generate video embed code
Paste a link, choose your options, and copy clean embed code for your website. The preview updates as you go.
Paste a video link to see the preview.
More free tools
Video tools
All platforms
Instagram tools
Pinterest tools
TikTok tools
How to embed a YouTube video on your website
Embedding a video keeps visitors on your page longer and adds rich media to blog posts, landing pages and course lessons. This YouTube embed code generator builds clean, ready-to-paste code with the options the standard share box doesn't give you.
Useful embed options
- Start and end time: play only the part that matters. You can also paste a link that already contains a timestamp.
- Responsive size: the video scales to fit phones, tablets and desktops without black bars.
- Privacy-enhanced mode: uses the youtube-nocookie.com address, which avoids storing viewing information about visitors until they press play. A sensible default for most sites.
- Autoplay and loop: handy for background or demo videos. Autoplay always starts muted, because browsers block autoplay with sound.
Embeds and page speed
Each embedded player adds weight to your page. If you have several videos on one page, consider showing a thumbnail image that loads the player only when clicked. You can grab an HD version with the thumbnail downloader.
Questions
Why does autoplay turn on mute?
Browsers block videos that play sound automatically, so autoplay only works when the video starts muted.
What is privacy-enhanced mode?
It uses a different address that doesn't store viewing information about visitors until they play the video. It's a good default for most websites.
Where do I paste the code?
Anywhere your website accepts HTML, such as a "Custom HTML" block in WordPress or an embed element in most site builders.