About YouTube Embed Generator
Pasting a YouTube link into a CMS usually gives a fixed-size iframe that breaks a responsive layout. Building the embed by hand means remembering a dozen query parameters, the allow list and the referrer policy — and the loop option has a quirk that quietly fails unless the video ID is repeated in the playlist parameter.
This generator turns a link and a few switches into a clean, copy-ready iframe: a fluid 16:9 wrapper by default, or a fixed 560 × 315 frame for systems that expect one. It previews the exact player first, so you can check autoplay, start time and privacy-enhanced mode before pasting the code into a page.
What this tool does
Live iframe preview
The generated player appears on the page and updates after you change an option, so autoplay, start time and loop can be checked before publishing.
Responsive 16:9 by default
The copied code wraps the iframe in a fluid 16:9 container that keeps its shape on phones, tablets and wide screens; a fixed-size option is one switch away.
Privacy-enhanced mode
Switch the embed domain to youtube-nocookie.com, which avoids setting YouTube cookies until the viewer starts playback.
Useful query parameters
Set a start time in seconds, mm:ss or hh:mm:ss; toggle autoplay, mute, loop, hidden controls and related-video suggestions with clearly labelled switches.
Loop that actually works
When loop is on, the tool adds the playlist parameter YouTube needs for a single video to repeat, instead of leaving it to fail silently.
Copy the URL or the HTML
Take just the iframe URL for a CMS field, or copy the complete HTML snippet with title, allow list and referrer policy already set.
How to use YouTube Embed Generator
- 01
Paste the video link
Paste a watch, share or Shorts link, or the 11-character video ID. The preview loads once the ID is valid.
- 02
Set the start time if needed
Enter seconds, mm:ss or hh:mm:ss. Leave the field empty to start at the beginning of the video.
- 03
Choose player options
Toggle autoplay, mute, loop, controls, related videos and privacy-enhanced mode; the live preview updates to match.
- 04
Pick a size
Keep the responsive 16:9 wrapper for modern pages, or switch it off for a fixed 560 × 315 iframe that older systems expect.
- 05
Copy the embed code
Press Copy embed HTML and paste the snippet into your page or CMS. Copy iframe URL is available for fields that only accept a source URL.
How this tool works
- Works with
- Embed code
- Processing
- Client-side, in your browser. Nothing is uploaded.
- Requirements
- Chrome, Edge, Firefox or Safari · Internet connection for the live preview
Limitations worth knowing
- The tool builds the official player; it cannot bypass video privacy, region blocks or a channel disabling embedding.
- Autoplay behaviour is decided by the viewer's browser and settings, and mute is required in most cases.
- Looping a single video relies on YouTube's playlist parameter, which can change outside this tool's control.
Privacy and file handling
The embed URL and HTML are generated in your browser; nothing you paste is uploaded or stored. Only the live preview iframe contacts YouTube, and it loads the nocookie domain when privacy-enhanced mode is enabled. If you copy the code into your own page, the player contacts YouTube from your visitors' browsers as the embed runs.
Read the full privacy policy