YouTube Embed Generator
Build a custom YouTube iframe embed code.
Generate YouTube Embed Code
Paste a YouTube link and this tool builds the iframe embed code for you, with toggles for autoplay, mute, controls, loop, start time, and privacy-enhanced mode. Copy the code or grab the live preview.
Options you can set
- Width and height (or responsive)
- Autoplay, mute, and player controls
- Start time and loop
- Privacy-enhanced (no-cookie) mode
Autoplay tip
Browsers block autoplay with sound, so if you enable autoplay you should also enable mute â otherwise most browsers will refuse to start the video automatically.
Privacy-enhanced mode
With privacy-enhanced mode on, the embed uses youtube-nocookie.com, which delays setting tracking cookies until the visitor actually plays the video. It's a simple way to be friendlier to privacy and cookie-consent rules.
Responsive embeds
The responsive option wraps the iframe in a 16:9 container that scales to its parent's width, so the video looks right on phones and desktops alike without a fixed pixel size.
Frequently Asked Questions
Common questions about the YouTube Embed Generator.