Generate the iframe embed code for any YouTube video — responsive, with the options you need. Here’s the exact pattern a good generator produces:
Basic embed
<iframe width="560" height="315"
src="https://www.youtube.com/embed/VIDEO_ID"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
Replace VIDEO_ID with the part after watch?v= or youtu.be/.
Responsive embed (scales on mobile)
<div style="position:relative;padding-top:56.25%">
<iframe src="https://www.youtube.com/embed/VIDEO_ID"
style="position:absolute;inset:0;width:100%;height:100%"
frameborder="0" allowfullscreen></iframe>
</div>
The 56.25% is the 16:9 aspect ratio (9 ÷ 16). Use 75% for 4:3.
Common parameters
| Parameter | Effect |
|---|---|
autoplay=1 | Start playing on load (requires mute=1 in most browsers) |
mute=1 | Start muted |
start=90 | Begin at 90 seconds |
loop=1&playlist=VIDEO_ID | Loop the video (loop needs the playlist param) |
controls=0 | Hide player controls |
rel=0 | Limit “related videos” to the same channel |
Append them to the embed URL with ? and join multiple with &, e.g. …/embed/VIDEO_ID?autoplay=1&mute=1&start=30.
The one-click generator that builds this from a pasted URL is being finished. Until then, copy a snippet above and swap in your video ID.