1. Home
  2. Text
  3. YouTube Embed Code Generator

YouTube Embed Code Generator

Pick start and end time and player options, then copy the iframe code.

Runs in your browser · No upload
Reads watch, shorts and youtu.be links, and 11-character IDs.
Formats like 1:23, 90 or 1m30s. Leave empty to skip.
Player options
Read aloud by screen readers. Use the video title.
iframe code
<iframe width="560" height="315" style="border:0" src="https://www.youtube.com/embed/jNQXAC9IVRw?start=83" title="Video title" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
Embed URL (src)
https://www.youtube.com/embed/jNQXAC9IVRw?start=83

Original video link: https://www.youtube.com/watch?v=jNQXAC9IVRw

This tool only generates code; it does not load the video on this page. Check the behavior on the page where you paste it.

How to use

  1. Enter the video link (or the 11-character ID). watch, shorts and youtu.be links all work.
  2. If you need it, add a start time and an end time as 1:23, 90 or 1m30s.
  3. Choose player options such as autoplay, loop or hidden controls, then pick a size.
  4. Copy the iframe code shown below and paste it into your blog’s HTML editor or your site source.

This tool only generates code and does not load the video on this page. Play it on the page where you paste it to confirm.

Options and the URL values they create

Option Value added to the URL Notes
Start time start=83 In seconds. 1 min 23 s is 83
End time end=150 Applied only when larger than the start
Autoplay autoplay=1 Browsers often block autoplay with sound, so pair it with mute
Start muted mute=1 Use together with autoplay
Hide controls controls=0 Hides the progress bar and buttons
Loop loop=1&playlist=VIDEO_ID To loop one video, playlist needs the same ID
Same-channel related rel=0 Limits end-of-video suggestions to the same channel (does not remove them)
Captions on cc_load_policy=1 Starts with captions on for videos that have them
No fullscreen fs=0 Removes the fullscreen button (allowfullscreen is dropped too)
No keyboard disablekb=1 Disables keyboard shortcuts
Mobile inline playsinline=1 Plays inside the page on phones instead of jumping to fullscreen
Language hl=en Language of the player menus

With a start of 83 seconds and an end of 150 seconds the address becomes https://www.youtube.com/embed/VIDEO_ID?start=83&end=150. Inside an HTML attribute the correct way to write & is &amp;, so the generated iframe code does that. The “Embed URL” box below copies with a plain &.

Size and responsive layout

Pick a fixed size from 560×315 (default), 640×360, 853×480, 1280×720 or the vertical 315×560, or type your own. Turning on “Stretch to container width” replaces the width and height attributes with style="width:100%;aspect-ratio:16/9;border:0", so the player follows its parent’s width and keeps 16:9. Responsive is the better choice to avoid overflow on mobile.

Privacy mode and accessibility

  • “Privacy-enhanced mode” switches the domain to youtube-nocookie.com. YouTube describes this mode as not storing cookies for the viewer until they play the video.
  • The iframe title is the description screen readers announce. If you leave it empty it falls back to “Video player”, so use the video’s title.
  • “Load when near the viewport” adds loading="lazy", so a video far down the page is not loaded until you scroll toward it.

Frequently asked questions

Autoplay does not start.

Browsers often block autoplay for videos with sound. A snippet with both autoplay and mute turned on works in most browsers.

How do I loop a single video?

With loop turned on, the code includes loop=1 and the same video ID in playlist. YouTube’s loop feature needs this form even for one video.

rel=0 only limits suggestions to videos from the same channel; it does not remove them. There is no option to remove them entirely.

I pasted it into my blog but nothing shows.

Whether iframes are allowed differs by service. Where HTML editing is blocked, paste just the video link or use that service’s own video embed feature.

Can I embed a private video?

A private video plays only for accounts that have permission, once logged in. To show it to ordinary visitors, set it to public or unlisted.

If you only need a plain link that starts at a given time, use YouTube Timestamp Link. To handle special characters in code by hand, see the HTML Entity Converter, and to set the preview that appears when a page is shared, use the Meta Tag Generator.

The link you enter is processed only in your browser and is never sent to a server.

Can't find the tool you need?

Tell us what you want to do. We build the most requested tools first.