What the generator does

The embed code in YouTube's share menu is usually a fixed 560×315 iframe on the standard domain with a long allow list. This tool prepares code that gives you more control: privacy-enhanced mode is on by default, the box follows the screen width through aspect-ratio, a title for screen readers is required and the allow attribute only lists what your chosen options need.

The code is never injected into this page as live HTML; it is shown as text. Parsing the link and building the code happen in your browser, and no request goes to YouTube at that stage.

How to use it

  1. Paste a video link or the 11-character video id.
  2. Write a short title that screen readers will announce, such as “Product setup video”.
  3. Optionally set a start and end time: 90, 1m30s, 1:30 and 1:02:03 are accepted.
  4. Choose autoplay, loop, controls, fullscreen, captions and layout options.
  5. Pick the code type: a direct iframe or the lightweight click-to-load snippet.
  6. Press “Generate”, then copy the code or download it as an HTML file. Open the live preview only if you want to.

Parameters, honestly explained

  • autoplay=1: browsers usually block autoplay with sound, so the tool warns you unless muted start (mute=1) is selected.
  • loop=1: for a single video YouTube also needs the same id in the playlist parameter; the tool adds it for you.
  • rel=0: this does not switch related videos off. Since 2018 YouTube only limits them to the same channel.
  • cc_load_policy=1 turns captions on by default; cc_lang_pref states a preferred language and has no effect if no captions exist in it.
  • start and end are in seconds; the end is measured from the beginning of the video and must be after the start.
  • controls=0 and fs=0 hide the control bar and the fullscreen button.

In fixed-size mode width and height must be at least 200 pixels, the minimum set by the YouTube API policies, which recommend at least 480×270 for 16:9 players. YouTube can change how parameters behave; the rules were last checked on 29 September 2026 against the YouTube player parameters documentation.

Privacy mode and the lightweight facade

Privacy-enhanced mode loads the player from www.youtube-nocookie.com. According to YouTube, viewing information is not used to personalise the experience before the visitor presses play. Once playback starts, cookies or similar storage may still be used, so this mode alone does not remove a consent requirement.

The facade snippet only puts a thumbnail and a play button on the page. When the visitor clicks, the iframe is created and the video starts. This saves scripts and requests on first load, but the thumbnail still comes from i.ytimg.com, which is a Google server. On some mobile browsers a second tap may be needed before playback begins.

Example and interpretation

With the input https://youtu.be/dQw4w9WgXcQ?t=1m30s&si=abc, the title “Product tour” and default settings, the result is:

<div style="position:relative;width:100%;aspect-ratio:16/9">
  <iframe
    src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?start=90"
    title="Product tour"
    width="560"
    height="315"
    style="position:absolute;inset:0;width:100%;height:100%;border:0"
    loading="lazy"
    allow="encrypted-media; picture-in-picture; fullscreen"
    allowfullscreen
    referrerpolicy="strict-origin-when-cross-origin">
  </iframe>
</div>

The t=1m30s value became start=90 and the si tracking parameter was dropped. width and height are only a fallback if styles fail to load. Autoplay is off, so autoplay is not in the allow list. If you also want structured data for the page, the Schema generator can prepare a VideoObject.

Limits and privacy

  • The tool does not check whether a video exists, is public or allows embedding; YouTube decides that.
  • The live preview only opens when you press “Load preview”. Your browser then connects to YouTube, and YouTube's own privacy terms apply.
  • If you include inputs in a share link, the video address and title are stored in the # part of that link.
  • Your site's Content Security Policy must allow the code; if frame-src does not include the YouTube domain, the iframe will not load.

Frequently asked questions

Does youtube-nocookie.com make cookie consent unnecessary?

No. Privacy-enhanced mode reduces tracking before playback, but YouTube may use storage once the video plays. Whether consent is needed depends on your own legal assessment.

Why does autoplay not work?

Most browsers block autoplay with sound. Turn on muted start; some mobile devices and low-power modes can block muted autoplay too.

Does rel=0 remove related videos completely?

No. It only limits the videos suggested at the end to the same channel.

How do I show a Shorts video vertically?

Choose the 9:16 aspect ratio in responsive layout. The tool warns you if a Shorts link is used with a 16:9 box.

Is the facade better for SEO or speed?

It is usually lighter on first load because it does not download the YouTube player scripts. Better rankings or scores are not guaranteed; measure the effect on your own pages.

Published: · Updated: