YouTube Embed Code Generator
Generate clean, responsive YouTube embed code. Set start time, autoplay, loop, mute, controls, and privacy-enhanced (youtube-nocookie) mode, then copy the iframe.
Options
Requires mute to work in most browsers.
Uses youtube-nocookie.com — fewer cookies.
How it works
- 1
Paste the video URL
Drop in any youtube.com, youtu.be, or Shorts link. The tool extracts the video ID automatically.
- 2
Configure the options
Toggle autoplay, loop, mute, controls, and privacy-enhanced mode. Set a start time if you want the embed to begin mid-video.
- 3
Copy the iframe
Click Copy and paste the responsive iframe into your page HTML or CMS.
Frequently asked questions
What is the youtube-nocookie.com privacy-enhanced embed?
When privacy-enhanced mode is enabled, YouTube uses youtube-nocookie.com as the embed domain and does not set cookies unless the visitor interacts with the player. This reduces GDPR / cookie consent friction on EU-facing sites.
Why does the loop option need a playlist parameter?
YouTube's loop=1 parameter only works in iframes when a playlist is also specified. The generator automatically adds playlist=VIDEO_ID (set to the same video) so the loop actually triggers.
Will autoplay work for visitors?
Most modern browsers block autoplay with sound. Autoplay works reliably only when combined with mute=1. Even then, some browsers suppress it if the visitor has not interacted with the page yet.
Is the embed responsive?
Yes. The generated iframe uses a padding-bottom: 56.25% wrapper to maintain a 16:9 aspect ratio at any container width.
Is this tool free?
Yes — completely free, no sign-up required, and runs entirely in your browser.
Related free tools
Make the content, not just the caption
Ghostfeed turns products into TikTok-style videos, slideshows, and AI UGC reactions — without filming or editing. Free tools get you started; Ghostfeed gets it posted.
Try Ghostfeed free