YouTube Embed Builder
A visual YouTube embed code generator. Toggle autoplay, loop, captions, controls, privacy mode, and start/end times — preview the result live, then copy the iframe HTML.
Paste a YouTube URL to start building.
How to use this tool
- 01
Paste the video URL
Watch URL or youtu.be — both work.
- 02
Configure the embed
Toggle autoplay, loop, captions, privacy mode, and set start/end times.
- 03
Copy the code
The live preview shows exactly what visitors will see; copy the embed HTML.
Why this matters
Embedding YouTube videos on a site looks simple but the parameter space is large: autoplay requires mute due to browser policies, privacy-enhanced mode uses a different domain, start and end times must be in seconds, captions default-on requires a specific parameter combination. Most creators copy YouTube's basic embed code and miss optimization opportunities or worse, accidentally enable autoplay in a way that fails silently on Chrome.
This tool exposes every meaningful embed parameter through toggleable controls with a live preview iframe — toggle a setting, see the result, then copy the final embed code. The autoplay-requires-mute interaction is handled automatically (toggling autoplay on auto-enables mute with an explanatory note). Output is clean HTML with proper accessibility attributes. Need a different aspect ratio? Wrap the output with the Responsive Iframe Wrapper.
Related tools
Build a modern aspect-ratio responsive embed snippet for YouTube, Vimeo, or any iframe URL, with a padding-bottom fallback.
Generate a self-contained lazy-load YouTube embed snippet. Shows the thumbnail until clicked, then loads the player. Saves 1MB+ per embed before interaction.
Generate a YouTube embed that uses youtube-nocookie.com to defer tracking cookies until viewer interaction. Helps with GDPR consent banner requirements.
FAQ
Explore the full toolkit
94 free tools covering titles, tags, thumbnails, scripts, captions, embeds, schema, and in-browser video processing.
Browse all tools →