Home › YouTube Embed Code Generator
YouTube Embed Code Generator
Paste a YouTube link and get a clean iframe embed code for your website or blog.
How to use the YouTube Embed Code Generator
- Paste the YouTube video, Shorts or youtu.be link.
- Choose a width and click Get Results.
- Copy the code into your page HTML.
About this tool
Embedding a video lets visitors watch on your page without leaving it. This tool builds an iframe using the youtube-nocookie.com domain, which avoids setting tracking cookies until the visitor plays the video. It keeps the standard 16:9 ratio and lazy loads the player to help page speed.
About YouTube video embed codes
How the embed code works
Paste a supported YouTube video URL or video ID. The tool extracts the video ID and builds an iframe using YouTube’s privacy-enhanced youtube-nocookie.com embed domain. The iframe uses a 16:9 layout based on the width you enter.
Check whether embedding is allowed
Some video owners disable embedding, and availability can depend on the video’s settings or restrictions. The generated code cannot override those settings. Test the embed on your own page after adding it.
Privacy and performance
The generated iframe includes lazy loading so the browser can defer loading it until it is near the viewport. The privacy-enhanced domain does not mean that no data is ever processed; YouTube may process information when the player is loaded or used.
Frequently asked questions
Can I embed any video?
Only if the owner allows embedding. Some videos disable it.
Why youtube-nocookie?
It is YouTube's privacy-enhanced embed domain.