Free · Private · Runs in your browser
YouTube Video Embed Code Generator
Paste any YouTube video link below and generate a ready-to-use iFrame embed code — with a live preview before you copy it to your website, blog, or CMS.
How to Embed a YouTube Video
Three steps, under a minute, entirely on your device.
Copy the video link
Open the YouTube video and copy its URL from the address bar or the Share button. Short youtu.be links, Shorts, and live URLs all work.
Paste and generate
Paste the link into the field above and click Generate Embed. The tool reads the video ID locally and builds the embed code for you.
Preview and copy
Check the live preview to confirm the video plays, then click Copy Embed Code and paste the snippet anywhere HTML is allowed.
Why Use This Embed Code Generator?
Live preview before you paste
Every generated embed comes with a working player preview, so you confirm the video plays correctly before touching your website's code.
Privacy-enhanced iFrame by default
The code uses youtube-nocookie.com, which delays YouTube tracking cookies until the visitor actually plays the video — friendlier for GDPR and privacy policies.
Every link format supported
Standard watch URLs, youtu.be short links, Shorts, embeds, and live URLs — if it contains a valid 11-character video ID, it works.
Free forever, no account
No sign-up, no limits, no watermarks. Generate as many embed codes as you like, on desktop or mobile, with nothing stored anywhere.
Understanding the Embed Code
The snippet this generator produces is the same iFrame tag YouTube itself gives you, with the video ID slotted into the player URL. The width and height values set the player's natural size — you can change them freely, or make the video responsive by wrapping the iFrame in a container with a 16:9 aspect ratio.
The rel=0 parameter tells the player to only show related videos from the same channel when playback ends, rather than unrelated recommendations from anywhere on YouTube.
You can also append ?start=90 to the player URL to make the video begin at 90 seconds, or autoplay=1 to start playing automatically (browsers only honor autoplay when the video is muted). One note: unlike a thumbnail, an embed requires the video owner to have allowed embedding — if a video refuses to play, the creator has switched it off.
Frequently Asked Questions
What is a YouTube video embed code?
An embed code is a small HTML snippet, usually an iFrame tag, that tells a web page to load a YouTube video player directly inside the page. Visitors can watch the video without leaving your site, and YouTube still counts the view on your channel.
Is this embed code generator free to use?
Yes. The generator is completely free with no account, no limits, and no watermark. The embed code it produces is the standard YouTube iFrame format used across millions of websites.
Which YouTube link formats are supported?
Standard watch URLs, youtu.be short links, Shorts, embeds, live URLs, and bare 11-character video IDs are all supported. Anything containing a valid video ID works.
Do embedded videos count as views on YouTube?
Yes. Views from a legitimate embed played inside your page count toward the video's total on YouTube, as long as the playback is genuine and follows YouTube's terms of service.
Can I embed YouTube videos on any website?
Yes, as long as the video's owner has allowed embedding. Every YouTube video is embeddable by default; if a video fails to play in your page, the creator has switched embedding off for it.