How to use
- Paste a YouTube link, existing embed code or 11-character video ID into the input.
- Choose 16:9, 9:16 or another ratio under Aspect ratio. Shorts links switch to 9:16 automatically.
- Check the preview using Phone 360, Tablet 768 or Full.
- Click Copy code to copy the embed code for your page.
Examples
Start a video at 42 seconds
https://www.youtube.com/watch?v=dQw4w9WgXcQ&t=42
<iframe src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?start=42&rel=0&playsinline=1" srcdoc="<style>*{padding:0;margin:0;overflow:hidden}html,body{height:100%}img,span{position:absolute;width:100%;top:0;bottom:0;margin:auto}img{height:100%;object-fit:cover}span{height:1.5em;text-align:center;font:48px/1.5 sans-serif;color:#fff;text-shadow:0 0 .5em #000}</style><a href='https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?start=42&amp;autoplay=1&amp;rel=0&amp;playsinline=1' aria-label='Play: YouTube video player'><img src='https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg' alt='YouTube video player' loading='lazy'><span>▶</span></a>" title="YouTube video player" loading="lazy" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen style="display:block;width:100%;height:auto;aspect-ratio:16/9;border:0;max-width:800px;margin:0 auto;"></iframe>Vertical Shorts embed
https://www.youtube.com/shorts/aqz-KE-bpKQ
<iframe src="https://www.youtube-nocookie.com/embed/aqz-KE-bpKQ?rel=0&playsinline=1" srcdoc="<style>*{padding:0;margin:0;overflow:hidden}html,body{height:100%}img,span{position:absolute;width:100%;top:0;bottom:0;margin:auto}img{height:100%;object-fit:cover}span{height:1.5em;text-align:center;font:48px/1.5 sans-serif;color:#fff;text-shadow:0 0 .5em #000}</style><a href='https://www.youtube-nocookie.com/embed/aqz-KE-bpKQ?autoplay=1&amp;rel=0&amp;playsinline=1' aria-label='Play: YouTube video player'><img src='https://i.ytimg.com/vi/aqz-KE-bpKQ/hqdefault.jpg' alt='YouTube video player' loading='lazy'><span>▶</span></a>" title="YouTube video player" loading="lazy" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen style="display:block;width:100%;height:auto;aspect-ratio:9/16;border:0;max-width:400px;margin:0 auto;"></iframe>Loop a course playlist
https://www.youtube.com/playlist?list=PLhQjrBD2T382_R182iC2gNZI9HzWFMC_8
<style>.yt-embed{display:block;width:100%;height:auto;aspect-ratio:16/9;border:0;max-width:800px;margin:0 auto}</style>
<iframe class="yt-embed" src="https://www.youtube-nocookie.com/embed/videoseries?list=PLhQjrBD2T382_R182iC2gNZI9HzWFMC_8&loop=1&rel=0&playsinline=1" title="YouTube video player" loading="lazy" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>FAQ
How does click-to-load work?
Click-to-load (lightweight) shows a thumbnail and loads the YouTube player only when you click play. The thumbnail loads immediately from i.ytimg.com, and the generated code needs no JavaScript on your site.
What does privacy-enhanced mode do?
Privacy-enhanced mode (youtube-nocookie.com) uses www.youtube-nocookie.com instead of www.youtube.com for the player in the embed URL. It does not stop all connections to YouTube. The preview on this page still loads a thumbnail or the player, depending on your settings.
How do I enable autoplay for a YouTube embed?
Turn off Click-to-load (lightweight), then turn on Autoplay on page load. The tool also turns on Mute and adds autoplay=1 and mute=1 to the embed URL.
Why does the preview say “Video unavailable”?
The tool generates code without checking whether the video exists or allows embedding. Check the video on YouTube and confirm that embedding is allowed.