YouTube Embed Code Generator
Build custom iframe embed code for any YouTube video.
How to use the YouTube Embed Code Generator
- Paste a YouTube video link or ID.
- Set the size and options.
- Copy the generated iframe embed code.
About the YouTube Embed Code Generator
This tool turns a YouTube link into ready-to-paste iframe embed code for your own site, with the options YouTube's own share dialog does not always expose. Paste a video URL or ID and it builds the code live, with a preview, letting you set the width and height, toggle fullscreen, and switch on privacy-enhanced mode.
Privacy-enhanced mode is the useful extra: it swaps the embed to the youtube-nocookie.com domain, which stops YouTube setting tracking cookies until the visitor actually plays the video. That is helpful for cookie-consent compliance and for keeping a page lighter on third-party tracking. The width and height fields let you match the embed to your layout instead of accepting the default 560×315.
Everything is built in your browser from the video ID and your chosen numbers — nothing is uploaded, and the video ID is validated so the code is always well-formed. To pull a video's title and thumbnail instead, use the YouTube title extractor; to estimate what a video might earn, see the YouTube money calculator.
Frequently asked questions
What is privacy-enhanced (no-cookie) mode?
It embeds the video from youtube-nocookie.com, which delays YouTube's tracking cookies until the viewer presses play. It helps with cookie-consent rules and reduces tracking.
Can I change the video size?
Yes. Set any width and height and the iframe code and preview update instantly. The classic default is 560 by 315.
Does it work with Shorts and youtu.be links?
Yes. It accepts full watch URLs, youtu.be short links, embed and Shorts links, or a bare 11-character video ID.
Is anything uploaded?
No. The embed code is generated in your browser from the video ID and your settings. Nothing is sent to a server.
How do I make the video responsive?
Set a width and height in the same ratio (like 16:9) and wrap the iframe in a container with CSS that scales it, or set the width to 100% in your own stylesheet.

