YouTube Embed Code Generator
Generate custom YouTube embed code with autoplay, start/end times, controls, mute, and loop.
Generate custom YouTube embed code with autoplay, start/end times, controls, mute, and loop.
Watch URL, youtu.be short link, or /shorts/ URL all work. The tool extracts the video ID and shows a live preview.
Autoplay (forces mute), Hide controls, Loop, Captions on, Restrict related videos, Privacy mode (youtube-nocookie.com). The preview updates as you toggle.
Use mm:ss or plain seconds — '1:30' or '90' both work. End without start is fine.
Plain iframe for forums and CMS embed fields. Responsive 16:9 wrapper for modern blogs and landing pages.
The snippet is everything you need — no script tags, no extra wrappers.
Field-tested principles for getting more out of this part of the workflow.
Read the related guide
Why embedded views still count and how to use blog embeds as a discovery channel.
12 min read
YouTube's built-in "Share → Embed" gives you a fixed iframe with a handful of toggles buried behind "Show more". This tool exposes the full set of player parameters in one place, shows you a live preview as you change settings, and produces both a plain iframe and a 16:9 responsive wrapper. No signup, no ads.
All processing happens in your browser. The video ID is parsed client-side, the iframe URL is built locally, and the snippet is generated without any network call.
Modern browsers block videos that autoplay with sound. The tool enables mute automatically when you turn on autoplay because that's the only combination that actually plays in Chrome, Safari, Firefox, and Edge. iOS Safari is even stricter and may still require a user tap.
Quirk of YouTube's embed player. Setting loop=1 alone has no effect for a single video. To loop one video, YouTube requires you to also pass playlist=<videoId> — which the tool does automatically when you enable Loop.
youtube-nocookie.com (Privacy-Enhanced Mode) doesn't drop tracking cookies on visitors until they actually press play. Functionally identical otherwise. Helpful for GDPR/CCPA compliance and reduces 'before consent' tracking complaints. The video count still gets logged.
rel=0 used to hide related videos entirely. Since 2018 YouTube changed the behaviour: it now only restricts suggestions to the same channel as the embedded video. There's no longer a way to fully suppress them.
Both are in seconds from the beginning of the video. The 'mm:ss' shortcut (e.g. 1:30) is parsed for convenience. Setting end without start works fine — the player starts at 0 and stops at the end value.
Responsive (16:9) for anything modern — blogs, landing pages, any layout that needs to look right on mobile. Plain iframe for forums, email templates, and old-school CMS embed fields that strip <div> wrappers.
Removed by YouTube in 2023. The YouTube logo now always appears on the control bar regardless of modestbranding=1. We don't expose the parameter because it no longer does anything.
Other free YouTube utilities you might need next.