SEO Check Tools

YouTube Embed Code Generator

Generate custom YouTube embed code with autoplay, start/end times, controls, mute, and loop.

How to use this tool

  1. 1

    Paste your YouTube video URL

    Watch URL, youtu.be short link, or /shorts/ URL all work. The tool extracts the video ID and shows a live preview.

  2. 2

    Toggle the player options you want

    Autoplay (forces mute), Hide controls, Loop, Captions on, Restrict related videos, Privacy mode (youtube-nocookie.com). The preview updates as you toggle.

  3. 3

    Set start and end times if you want a clip

    Use mm:ss or plain seconds — '1:30' or '90' both work. End without start is fine.

  4. 4

    Pick output format

    Plain iframe for forums and CMS embed fields. Responsive 16:9 wrapper for modern blogs and landing pages.

  5. 5

    Copy and paste into your HTML

    The snippet is everything you need — no script tags, no extra wrappers.

YouTube SEO tips

Field-tested principles for getting more out of this part of the workflow.

  • Embedded YouTube videos count toward your watch time even when viewers don't visit YouTube itself — your video benefits whether the play happens on your blog or on the platform.
  • Privacy-enhanced mode (youtube-nocookie.com) is the right default for any embed on a site with GDPR or CCPA concerns. Functionality is identical.
  • Autoplay requires mute on modern browsers. The tool forces mute automatically when you enable autoplay.
  • Loop alone doesn't work — YouTube requires playlist=videoId for single-video looping. The tool wires this up for you.
  • rel=0 since 2018 restricts suggestions to the same channel only — it no longer fully hides them.
  • Use the responsive wrapper on any site that ever loads on mobile. Plain iframes break on phones.
  • Embedded plays show up in YouTube Studio's analytics under 'External', so you can measure the contribution to overall channel performance.

Read the related guide

YouTube SEO in 2026: The Complete Guide

Why embedded views still count and how to use blog embeds as a discovery channel.

12 min read

About the Embed Code Generator

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.

Supported player parameters

  • autoplayPlays automatically (requires mute on most browsers)
  • muteStarts muted
  • controlsShow player UI (timeline, buttons)
  • loopRepeats forever (sets playlist=videoId automatically)
  • cc_load_policyCaptions on by default
  • relRestrict suggestions to the same channel
  • start / endTrim playback to a specific time range

Frequently asked questions

Why doesn't autoplay work for me?+

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.

Why does loop need a 'playlist' parameter?+

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.

What's the difference between youtube.com and youtube-nocookie.com?+

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.

Why doesn't 'Restrict related videos' fully hide them?+

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.

How do start and end time work?+

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.

Should I use plain iframe or responsive wrapper?+

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.

What about modestbranding?+

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.

Related tools

Other free YouTube utilities you might need next.