YouTube Embed Code Generator

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

Paste a YouTube link to get embed code for your website: responsive 16:9 or fixed size, privacy-enhanced mode, start and end times, autoplay (muted), loop, captions, hidden controls and lazy loading. Works with videos, Shorts and playlists.
Try an example:

Output will appear here...

About YouTube Embed Code Generator

How it works

  1. The video ID (and playlist ID, if any) is read from any YouTube link - watch, youtu.be, Shorts, embed or live - and a start time in the link (t=90 or t=1m30s) is kept.
  2. Your choices become standard YouTube player parameters (start, end, autoplay, mute, loop, controls, cc_load_policy) on an embed URL.
  3. Privacy-enhanced mode uses youtube-nocookie.com, which does not store cookies for visitors until they play the video.
  4. The responsive option wraps the player so it keeps a 16:9 shape at any screen width.

What you need

  • A link to a public or unlisted YouTube video or playlist that allows embedding.

Tips

  • Browsers block autoplay with sound, so autoplay also mutes the video.
  • Looping a single video needs a playlist parameter with the same video - the tool adds it for you.
  • Lazy loading delays loading the player until it scrolls into view, which speeds up your page.

Limitations

  • Some owners disable embedding; those videos show an error on other sites.
  • YouTube may still show related videos from the same channel at the end.

Runs in your browser. Everything is generated in your browser - nothing you enter is sent anywhere.

Frequently asked questions

How do I embed a YouTube video at a specific time?+

Enter the start time (like 1:30 or 90) in "Start at", or paste a link that already has ?t=90. The embed code includes start=90.

Why does autoplay not work?+

Browsers only allow autoplay when a video is muted, so the tool mutes autoplaying videos. Some browsers and data-saver modes block autoplay entirely.

What is privacy-enhanced mode?+

Embedding from youtube-nocookie.com, which avoids setting tracking cookies for visitors until they play the video. It helps with privacy regulations like GDPR.