YouTube Embed Code Generator

Create responsive YouTube embed code with autoplay, mute, loop, start time and privacy mode.

How to Embed a YouTube Video on Your Website

  1. Paste the YouTube video link above.
  2. Choose a size – Responsive is best for most websites because it fits phones and desktops.
  3. Turn on the options you need, click Generate Embed Code and copy the code.
  4. Paste it into your page. In WordPress, use a Custom HTML block; in Blogger, switch to HTML view.

What Each Embed Option Does

OptionWhat it does
AutoplayStarts playing when the page loads. Browsers only allow this when the video is muted, so the tool mutes it automatically.
MuteStarts with sound off.
LoopRestarts the video when it ends.
Show controlsShows or hides the play bar and volume controls.
Start atBegins playback at a chosen second.
Privacy-enhanced modeUses youtube-nocookie.com so YouTube doesn’t store viewing cookies until the visitor plays the video.

Tips for Faster Pages with YouTube Embeds

  • Embed only the videos that matter – every iframe adds weight to your page.
  • Place videos below the first screen so the main content loads first.
  • Add loading="lazy" to the iframe tag so the player only loads when visitors scroll to it.

Frequently Asked Questions

Is it allowed to embed YouTube videos?

Yes, if the uploader has not disabled embedding. Embedding plays the video from YouTube, so views count for the creator.

Why doesn’t autoplay work with sound?

Modern browsers block autoplay with sound. Muted autoplay is allowed, which is why the tool adds mute=1.

How do I make a YouTube embed responsive?

Select “Responsive” in the size menu. The code wraps the iframe in a 16:9 container that scales to any screen width.

More Free Tools