Skip to content
Everyone-Website

YouTube Embed Code Generator

Turn any YouTube link into a clean, responsive <iframe> embed — set a start time, autoplay, loop, privacy mode and more, with a live preview.

Developer Your files never leave your device.

How to use YouTube Embed Code Generator

  1. Paste a YouTube link

    Drop in any YouTube URL — a watch link, a youtu.be short link, a Shorts link, or even an existing embed URL. The video ID is detected automatically; you can also paste a bare 11-character ID.

  2. Choose your options

    Pick a responsive 16:9 layout or a fixed size, then set a start/end time and toggle autoplay, mute, loop, controls and privacy mode to match how you want the video to behave.

  3. Preview it (optional)

    Open the live preview to see the exact player your visitors will get — nothing is loaded from YouTube until you choose to preview.

  4. Copy the embed code

    Copy the generated <iframe> (or download it as an .html file) and paste it into your website, blog, CMS or email template. That’s it.

Key features

  • Reads the video ID from watch, youtu.be, Shorts and embed links
  • Responsive 16:9 wrapper or a custom fixed width and height
  • Start time, end time, autoplay, mute, loop and hide-controls options
  • Privacy-enhanced no-cookie mode on by default (youtube-nocookie.com)
  • Optional “limit related videos” to keep viewers on your content
  • Built-in accessible title attribute for screen readers and SEO
  • Opt-in live preview — no network requests until you ask for one
  • Runs entirely in your browser — free, no sign-up, nothing stored

About YouTube Embed Code Generator

Paste a YouTube link and get ready-to-use embed code in seconds. This generator reads the video ID from any YouTube URL — a normal watch link, a short youtu.be link, a Shorts link, even an existing embed URL — and builds a clean <iframe> you can drop straight into a website, blog, CMS or newsletter. Choose a responsive 16:9 wrapper that scales to any screen, or set a fixed width and height. Fine-tune playback with start and end times, autoplay, mute, loop and hidden controls, and keep things tidy by limiting the “related videos” shown at the end. Privacy mode is on by default, so the code uses YouTube’s no-cookie domain (youtube-nocookie.com) to avoid setting tracking cookies until someone actually plays the video. An optional live preview shows exactly what visitors will see before you copy anything. Everything runs in your browser — no sign-up, no limits, and the tool never downloads or re-hosts the video; it simply produces the standard YouTube embed markup, the same way YouTube’s own “Share → Embed” button does, but with more control.

Last updated 6 June 2026.

Frequently asked questions

How do I embed a YouTube video on my website?
Paste the video’s link into the box above, adjust any options you want (size, start time, autoplay, and so on), then copy the generated <iframe> code and paste it into your page’s HTML where you want the video to appear. The embed is the standard YouTube player, so it works in virtually any website, blog or CMS that lets you add HTML.
How do I make a YouTube embed responsive?
Leave the “Responsive (16:9)” option turned on. Instead of a fixed pixel size, the tool wraps the iframe in a container with a 16:9 aspect ratio and absolutely-positioned iframe, so the video automatically scales to the full width of wherever you place it — looking right on phones, tablets and desktops without any extra CSS.
Can I start the video at a specific time?
Yes. Type a start time (and optionally an end time) in seconds or m:ss format — for example 90 or 1:30. The tool adds the start and end parameters to the embed URL so the player begins, and optionally stops, exactly where you want. If your pasted link already contains a “?t=” timestamp, it’s detected for you.
How do I make a YouTube video autoplay or loop?
Turn on Autoplay to start the video automatically, and Loop to replay it continuously (the tool sets the playlist parameter automatically, which is required for a single video to loop). Note that browsers only allow autoplay when the video is muted, so switch on Mute as well if you need autoplay to work reliably.
What is privacy-enhanced (no-cookie) mode?
With Privacy mode on, the embed uses youtube-nocookie.com instead of youtube.com. In this mode YouTube doesn’t store information about visitors with cookies unless they actually play the video, which is friendlier for privacy and can help with cookie-consent requirements. It’s enabled by default here.
Does this download the YouTube video?
No. This tool does not download, copy or re-host any video — that would breach YouTube’s Terms of Service. It only generates the official embed markup (the same <iframe> YouTube’s own Share → Embed produces), which streams the video directly from YouTube with the creator’s ads and analytics intact.
Is anything sent to a server?
No. The embed code is built entirely in your browser from the link you paste, so the generator works offline once loaded and nothing is uploaded or stored. The only time anything is fetched from YouTube is if you open the optional live preview, which loads the real player so you can see the result.