YouTube Embed Code Generator
Paste a video, Short or playlist and build the iframe with every option the player takes — autoplay, loop, start and end times, no-cookie mode, responsive size.
Paste a link above and the player appears here
Nothing loads from YouTube until a link is pasted.
<!-- paste a YouTube link to get the iframe -->How it works
How to get the embed code for a YouTube video?
Paste the YouTube URL
A video, a Short, or a playlist — from the address bar or the Share button.
Set the player up
Autoplay, mute, loop, start and end times, captions, controls, colours, language.
Pick the size
Responsive to the column it sits in, or fixed pixels like YouTube writes it.
Copy the iframe
One press, straight into your page, theme, or CMS block.
The preview is the embed — the same src the copied code carries, in a real iframe. So the honest test is right there: press play, scrub, check the start time lands where you meant before the code goes anywhere near your page.
Where it pays off
Where the extra options earn their place?
Start on the part that matters
Link a demo at 4:12 and stop it at 5:30 — no “skip ahead to” in the caption.
A frame that fits every screen
The responsive wrapper keeps 16:9 on a phone and a monitor. 9:16 for Shorts.
No cookie until they press play
Privacy-enhanced mode is the default here — the usual answer to a cookie banner.
Pages with several videos
Lazy loading keeps the players out of the first paint, so the page still feels quick.
Under the hood
What each option writes into the URL?
Every control is one documented IFrame player parameter. Handy if you are reading someone else’s embed, or writing the URL by hand.
| Parameter | What it does |
|---|---|
autoplay=1 | Starts on load — only when the player is also muted. |
mute=1 | Starts silent; the viewer can unmute in the player. |
loop=1 | Repeats. A single video also needs playlist=VIDEO_ID. |
start / end | Seconds from the beginning to start and stop at. |
controls=0 | Hides the whole control bar. |
rel=0 | End-screen suggestions come from the same channel only. |
cc_load_policy=1 | Turns captions on by default. |
cc_lang_pref | Which caption language to prefer, e.g. en. |
hl | Language of the player’s own buttons and tooltips. |
fs=0 | Removes the fullscreen button. |
playsinline=1 | Plays in the page on iPhone instead of fullscreen. |
disablekb=1 | Turns off the player’s keyboard shortcuts. |
iv_load_policy=3 | Hides video annotations. |
color=white | White progress bar instead of red. |
youtube-nocookie.com | Privacy-enhanced host: no tracking cookie until play. |
Questions