Generate customizable YouTube iframe embed code with autoplay, start/end time, captions, loop, and no-cookie privacy mode. Live preview, free, no signup.
Who Uses YouTube Embed Code Generator
Bloggers embedding video tutorials in posts. Marketers building landing pages with above-the-fold autoplay reels. Course creators embedding lessons that start at a specific time. Privacy-conscious teams using privacy-enhanced mode.
YouTube Embed Code Generator Features
- Custom iframe Builder: Generate clean iframe HTML with the exact YouTube parameters you need - autoplay, mute, loop, and more.
- Live Preview: See the embed render instantly as you tweak settings - no need to publish to test.
- No-Cookie Privacy Mode: Uses youtube-nocookie.com, so views on your page don't shape the viewer's YouTube experience or the ads they see elsewhere.
- Start & End Time Control: Set the embed to start at a specific moment and stop at another - perfect for highlight reels.
- Captions On by Default: Show captions by default, even if the viewer has turned them off. Uses cc_load_policy=1.
- One-click Copy: Copy the production-ready iframe HTML - already includes lazy-loading and accessibility attributes.
How to Use YouTube Embed Code Generator
Build a fully customized YouTube embed iframe in three steps
- Paste a YouTube URL: Drop in any youtube.com, youtu.be, embed, or Shorts URL.
- Customize the Embed: Toggle autoplay, captions, loop and privacy mode, and set the size, shape, start and end time.
- Copy the iframe Code: Copy the generated HTML and paste it into your blog, landing page, or CMS.
Frequently Asked Questions
How do I make a YouTube video autoplay on my website?
Toggle Autoplay on. The tool turns on Mute with it, because Chrome always allows muted autoplay, while autoplay with sound usually needs the visitor to have interacted with your site first. Note that YouTube says autoplayed embeds don't add to the video's view count.
What does no-cookie privacy mode actually do?
It switches the embed domain to youtube-nocookie.com, YouTube's privacy-enhanced mode. YouTube says views of the embed then don't influence the viewer's experience on YouTube and aren't used to personalise ads outside your site, and any ads in the player are non-personalised. It works for embedded players on websites.
Does Modest Branding still hide the YouTube logo?
No. YouTube deprecated modestbranding in August 2023 and says it now has no effect; the player decides the branding itself. The tool still offers it for old code, marked as having no effect.
Can I make the embed loop a single video?
Yes. Toggle Loop on. The tool adds playlist with the same video ID, which YouTube's docs say a single-video loop needs. YouTube notes loop has limited support in iframe embeds.
How do I make the embed responsive?
Pick Responsive under Player size. The code then fills the width of its container, up to the width you set, and keeps the shape. Fixed size keeps the exact width and height.
Is the generated code accessibility-friendly?
The iframe includes a title attribute ("YouTube video player"), loading="lazy", allowfullscreen, and the standard allow attribute for picture-in-picture and similar features.
Does this work for YouTube Shorts?
Yes. Paste any youtube.com/shorts/ID URL. The tool reads the video ID and switches to a 9:16 player for you.
Are my URLs sent to a server?
No. All parsing and code building happens in your browser. Only the live preview loads the player from YouTube. Your last 5 embeds are saved in this browser only.
Related: youtube embed code generator, youtube iframe generator, youtube embed customizer, youtube no-cookie embed, responsive youtube embed, youtube embed start time