YouTube Chapter Generator

YouTube Embed Code Generator

Build the iframe code for any YouTube video. Start/end time, autoplay, loop, responsive sizing — toggle and copy.

YouTube embed parameters cheat sheet

Every option in the tool above maps to a query parameter on the youtube.com/embed/VIDEO_ID URL. These are the ones that still do something in 2026:

ParameterValuesWhat it does
startsecondsBegin playback at this offset (whole seconds).
endsecondsStop playback at this offset.
autoplay0 | 1Play on load — only works together with mute=1.
mute0 | 1Start muted. Required for autoplay in every modern browser.
loop0 | 1Repeat — requires playlist=VIDEO_ID with the same ID.
playlistvideo IDThe one-item playlist that makes loop=1 work.
controls0 | 1Hide or show the play bar and buttons.
playsinline0 | 1Play inline on iOS instead of forcing fullscreen.
cc_load_policy1Force captions on by default.
cc_lang_prefISO codePreferred caption language, e.g. cc_lang_pref=es.
hlISO codePlayer interface language.
rel0 | 10 limits end-of-video suggestions to the same channel.
colorred | whiteProgress bar color.
enablejsapi0 | 1Allow control from the IFrame Player API.
originyour URLRequired alongside enablejsapi=1 as an origin check.

Four parameters that don't work the way tutorials claim

  • autoplay=1 alone does nothing. Chrome, Safari and Firefox all block unmuted autoplay. You need autoplay=1&mute=1 — a muted autoplay is the only kind browsers will start without a user gesture.
  • loop=1 alone does nothing either. A single-video loop is implemented as a one-item playlist, so you must also pass playlist=VIDEO_ID with the same ID. Without it the video simply ends.
  • rel=0 no longer hides related videos. Since 2018 it only restricts the end-of-video suggestions to the same channel as the embedded video. There is no supported way to turn suggestions off entirely.
  • modestbranding=1 is deprecated. YouTube retired it in 2023; the player chrome is the same with or without it. Leave it out rather than shipping dead query string.

Privacy-enhanced mode (youtube-nocookie.com)

Swap the host for www.youtube-nocookie.com and the player stops writing tracking cookies until the viewer actually starts the video. Every parameter above works identically on that domain. If your site shows a cookie banner in the EU, this is usually what lets an embed load before consent:

<iframe src="https://www.youtube-nocookie.com/embed/VIDEO_ID?rel=0"
  title="Video player" frameborder="0"
  allow="accelerometer; clipboard-write; encrypted-media; picture-in-picture"
  allowfullscreen></iframe>

Two things worth keeping on every embed regardless: a titleattribute (screen readers announce an untitled iframe as just "iframe") and loading="lazy" on embeds below the fold — a YouTube iframe pulls roughly half a megabyte before anyone presses play.

Responsive embed (16:9)

The classic CSS hack: wrap the iframe in a div with padding-bottom: 56.25% (which is 9/16 expressed as a percentage), set the iframe to absolute fill. The container now scales fluidly with its parent width, keeping the 16:9 aspect ratio:

<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
  <iframe
    style="position:absolute;top:0;left:0;width:100%;height:100%;"
    src="https://www.youtube.com/embed/VIDEO_ID"
    allowfullscreen></iframe>
</div>

The Responsive toggle in the tool generates this automatically.

Embedding a single moment

Set both start and end to embed only the part of the video that matters. Example: a 6-second loop of a key moment of a podcast, autoplaying and muted. Combined with loop=1, you get a custom video clip without re-uploading. See also our timestamp link generator for the share-link version of this.

FAQ

How do I embed a YouTube video without cookies?
Use www.youtube-nocookie.com/embed/VIDEO_ID instead of www.youtube.com/embed/VIDEO_ID. The player then holds off on tracking cookies until the viewer presses play. Every embed parameter works the same on that domain.
Does modestbranding=1 still remove the YouTube logo?
No. YouTube deprecated modestbranding in 2023 and the player looks identical with or without it. There's no supported way to remove YouTube branding from an embed.
How do I embed a YouTube video on my website?
Paste the YouTube URL into the box above, choose your options (size, autoplay, start time, etc.), copy the generated iframe code, and paste it into your website's HTML wherever you want the video to appear.
Can I make a YouTube embed responsive?
Yes. Toggle the Responsive option in the tool — it wraps the iframe in a div with padding-bottom: 56.25% (16:9 ratio) so the video scales fluidly with its container width.
Why doesn't my YouTube embed autoplay?
Modern browsers block autoplay unless the video is muted. Our tool automatically adds mute=1 when autoplay=1 is set so the autoplay actually works.
Can I make a YouTube embed start at a specific time?
Yes. Set the start hours/minutes/seconds in the tool. The tool adds start=SECONDS to the embed URL. You can also set an end time so the video stops there.
Can I loop a YouTube embed?
Yes — toggle Loop. The tool adds loop=1 and the required playlist=VIDEO_ID parameter so the video restarts at the end.
What are the YouTube embed parameters?
The most useful: start (seconds), end (seconds), autoplay (0/1), mute (0/1), loop (0/1), controls (0/1), modestbranding (1). All go after the embed URL as query parameters.

More free YouTube tools

Every tool works the same way: paste a video URL, get the output. Free, no signup.