EN

Generator

Runs in your browser

Source

Options









Preview

< waiting for a YouTube URL >

Nothing typed here is sent anywhere. Code is generated client-side. Independent tool, not affiliated with YouTube or Google.

Paste any YouTube link into the tool above and it builds a clean, responsive, privacy-friendly <iframe> embed code for you: start time, autoplay, mute, loop, hidden controls, Shorts format, playlists and lazy-loading are all supported.

What each option actually does

Every setting maps to a real YouTube player parameter, so it is worth knowing what happens when you switch it on.

  • Privacy-enhanced mode switches the embed domain from youtube.com to youtube-nocookie.com. YouTube does not set tracking cookies on this domain until playback actually starts, which makes it a common choice for GDPR-conscious websites.
  • Responsive wrapper outputs a wrapper <div> with a percentage-based padding instead of fixed pixel dimensions, so the player scales fluidly with its container on any screen size.
  • Lazy-load adds the native loading=”lazy” attribute, so the browser only requests the player once it scrolls near the viewport. This keeps pages with several embeds fast.
  • Start and end time use the start and end parameters (in whole seconds) so playback begins, and optionally stops, exactly where you want.
  • Shorts format switches the preview and responsive wrapper to a 9:16 portrait ratio, matching how Shorts are actually filmed and watched.
  • Playlist mode swaps the single-video embed for /embed/videoseries with a list parameter, so the player shows an entire playlist with its own queue.

Why use this instead of copying YouTube’s own share code?

YouTube’s built-in “Share > Embed” panel is a good starting point, but it does not give you a responsive wrapper, does not offer the privacy-enhanced domain by default, and makes it fiddly to combine options like a custom start time with hidden controls or a Shorts-shaped player. This generator produces the same underlying <iframe>, just with all of those combinations available through simple toggles, and a live preview so you can check the result before you publish it.

Where to paste the code

The generated HTML works anywhere you can add raw HTML: a WordPress Custom HTML block, a Shopify theme section, a Wix embed widget, or directly in a static site’s markup. See our guides on embedding in WordPress, Shopify and Wix for platform-specific steps.

How to use this YouTube embed code generator, step by step

  1. Paste a YouTube URL or an 11-character video ID into the field above. Watch links, Shorts links, youtu.be links and playlist links are all recognised automatically.
  2. Toggle the options you need: privacy-enhanced mode is on by default, along with a responsive wrapper and lazy-loading.
  3. Set a start time (and optionally an end time) if you want playback to begin partway through the video.
  4. Check the live preview, then copy the generated code with the copy button and paste it into your page’s HTML.

Who uses a YouTube embed code generator

This YouTube embed code generator is used by website owners embedding a single explainer video, agencies building client sites that need consistent, privacy-friendly embeds, teachers and course creators linking a lesson to start at the right moment, and developers who want correct, responsive markup without writing the padding-bottom percentage by hand each time.

Frequently asked questions

How do I embed a YouTube video without cookies?

Keep the “Privacy-enhanced” option checked. This switches the embed to the youtube-nocookie.com domain, which does not set tracking cookies until a visitor actually presses play.

How do I make a YouTube embed responsive?

Keep the “Responsive wrapper” option checked. The generator then outputs a percentage-based wrapper div instead of fixed pixel dimensions, so the player scales with its container on any screen.

How do I embed a YouTube video that starts at a specific time?

Enter a number of seconds in the “Start” field. The generator adds a start parameter to the embed URL so playback begins exactly there.

Can this generator embed a YouTube Shorts video?

Yes. Paste a /shorts/ link or check the Shorts option manually, and the responsive wrapper switches to a 9:16 vertical ratio automatically.

Does this generator work for playlists?

Yes. Check “Treat as playlist” (or paste a link containing a list= parameter) and the generator builds a /embed/videoseries embed instead of a single-video one.

For a full parameter-by-parameter breakdown, see 12 YouTube embed parameters explained. For performance tips, see 9 ways to speed up pages with YouTube embeds, and for privacy, see GDPR and YouTube embeds.