Free YouTube Embed Code Generator
This free YouTube embed code generator turns any video link into an iframe you can paste into a web page. It uses the privacy-enhanced youtube-nocookie.com address, adds lazy loading so the page loads faster, and lets you set a start time, size and player options. You also get a responsive 16:9 version and a live preview.

YouTube Embed Code Generator
YouTube
About this tool
Embedding a video lets visitors watch it without leaving your page, but the default code YouTube gives you loads the player immediately and sets cookies before anyone presses play. This generator builds a better iframe: it points at youtube-nocookie.com, which delays tracking cookies until the visitor plays the video, and it adds loading="lazy" so the player only loads when the visitor scrolls close to it.
Paste any kind of YouTube link: a watch address, a short youtu.be link, a Shorts, live or embed address, or just the 11 character video ID. If the link has a time such as t=90 or t=1m30s, it is used as the start time automatically. You can also set an end time, choose a fixed size or the responsive version that scales to the width of the page, and decide whether related videos should be limited to your own channel.
Privacy-enhanced mode reduces tracking, but it does not make a page free of consent duties in every country, so check the rules that apply to your visitors. A lazy-loaded iframe also helps page speed, which is a ranking and experience factor. Always give the iframe a clear title, which screen readers announce. The preview below the code is loaded from YouTube by your own browser and not by our server.
Frequently asked questions
What does privacy-enhanced mode do?
It uses the youtube-nocookie.com address, so YouTube does not store tracking information about visitors on your page until they actually play the video. It is not a full consent solution, but it is a sensible default for most sites. You can switch it off if you prefer the standard address.
Does lazy loading really make my page faster?
Yes, especially for pages with a video below the first screen. With loading="lazy", the browser fetches the player only when the visitor scrolls near it, instead of downloading the player code on every page view. It is supported by all current browsers and is safe to leave on.
How do I make the video start at a certain time?
Type the start time in seconds, or as minutes and seconds such as 1:30, in the start field. A link that already contains a time, like t=90, is picked up automatically. The embed then begins playing from that point once the visitor presses play.
Which link formats work?
Watch links, youtu.be short links, Shorts, live and embed addresses, and a bare 11 character video ID all work. Playlist and channel links are not supported because they do not point to a single video. Remove the playlist part of the link if you only want one video.
Does this tool store my link?
No. The link is read on our server only to pull out the video ID and build the code. We do not contact YouTube from the server, and nothing is saved. The preview loads from YouTube in your own browser.
