YouTube Embed Code Generator
Paste URL or ID → get responsive wrapper + plain iframe (preview right, code bottom)
YouTube URL or ID
Aspect ratio
16:9
4:3
1:1 (square)
Start (s)
End (s)
Player options
Autoplay
Mute
Controls
Loop
Captions
Modest branding
Privacy (nocookie)
Lazy load
Generate
Reset
Copy last
Tip: Autoplay usually requires mute to work reliably across browsers.
Preview (responsive wrapper)
Preview will appear here
Open src
Reload preview
Generated code — Responsive wrapper
<div...>…</div>
Copy wrapper HTML
Open src in new tab
Generated code — Plain iframe
<iframe src="…" ></iframe>
Copy iframe HTML
Copy src URL
Note: Use the responsive wrapper for fluid embeds; use the plain iframe if you want a fixed iframe you style manually.