YouTube Embed Code: Responsive and Privacy-Friendly
The default YouTube embed code is fixed-width and sets cookies before anyone presses play. Here is the version that is responsive, lazy and privacy-enhanced.

loading="lazy", and the youtube-nocookie domain.The embed code worth pasting
<div style="position:relative;padding-top:56.25%">
<iframe
src="https://www.youtube-nocookie.com/embed/VIDEO_ID"
title="Descriptive title of the video"
loading="lazy"
style="position:absolute;inset:0;width:100%;height:100%;border:0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</div>padding-top:56.25%— that is 9 ÷ 16, which reserves the correct height before
youtube-nocookie.com— YouTube's privacy-enhanced domain. It defers
loading="lazy"— the player is not fetched until it approaches the viewport.
title— required for screen readers. An iframe with no title is announced as
Parameters that still do something
| Parameter | Effect |
|---|---|
start=90 | Begin at 90 seconds — note: start, not t |
end=180 | Stop at 180 seconds |
rel=0 | Restricts related videos to the same channel |
modestbranding=1 | Deprecated; it no longer has an effect |
autoplay=1 | Requires mute=1 in most browsers to work at all |
cc_load_policy=1 | Captions on by default |
playsinline=1 | Plays inline on iOS rather than going fullscreen |
start distinction catches people out: a YouTube timestamp link uses t=, but the embedded player wants start=. Paste a t= value into an iframe and the video quietly starts at zero.rel=0 no longer removes related videos entirely — it limits them to the same channel, which is still worth setting if you would rather not send a reader to a competitor at the end of a clip.Why the default embed is a performance problem
loading="lazy" solves the fetch half for embeds below the fold. What neither solves is the cost of the player itself once it does load, which is what the next section is for.The facade pattern, if performance really matters
Embedding a channel or a playlist
/embed/videoseries?list=PLAYLIST_ID. There is no supported embed for a whole channel — the usual substitute is embedding the channel's uploads playlist, or building a feed:How do I make a YouTube embed responsive?
padding-top:56.25% and position the iframe absolutely inside it. That reserves 16:9 space at any width without JavaScript.What is youtube-nocookie.com?
Why does my timestamp not work in an embed?
start= in seconds; t= only works on watch and share links.Does modestbranding still work?
Put it to work
Tools for the job you just read about
Free to run, most of them without an account.
YouTube Embed Code Generator
Embed code with the parameters that still work, and none that quietly do not.
YouTube Thumbnail Downloader
Grab every thumbnail size from any YouTube video in one click.
YouTube RSS Feed Generator
The feed YouTube publishes for every channel, and links to from nowhere.
Google SERP Snippet Preview
See your title and description as a Google result — on a desktop and a phone.
Social Media URL Cleaner
Strip the tracking off a link — and see what each parameter was telling somebody.
Instagram Money Calculator
What to charge for a post — priced the way a brand actually prices it.
Keep reading
More from the blog

How to Get the RSS Feed for a YouTube Channel
Every YouTube channel and playlist publishes an RSS feed. Here is the URL format, how to find the ID it needs, and what the feed does and does not include.

How to Get an Instagram Embed Code
Instagram removed the embed button from the web interface, but the embed itself still works. Here is how to build the code from a post URL, in both forms.

How to Embed a Social Media Post on Your Website
Every platform publishes embed code and most hide it. Here is where each one keeps it, when to use an iframe instead of a script, and what to do about consent.