YouTube Embed Code Generator

Generate ready-to-use YouTube iframe embed code from a video URL without a YouTube API key.

All tools
Supports YouTube watch, youtu.be, Shorts, embed and live URLs.
Turn off Responsive embed to set an exact width and height. The generated result includes a live visual preview of the selected size.
Ready-to-use iframe code Generate HTML you can paste into a website or blog.
Responsive option Create a 16:9 responsive embed instead of a fixed-size iframe.
Privacy-enhanced mode Use YouTube's youtube-nocookie.com embed domain when enabled.

What Is a YouTube Embed Code?

A YouTube embed code is HTML that places a YouTube video player on another website or blog. The standard approach uses an HTML <iframe> pointing to a YouTube /embed/ URL.

The iToolsEra YouTube Embed Code Generator creates this code from a supported YouTube video URL so you can copy it into your website.

How Does the YouTube Embed Code Generator Work?

  1. Paste a YouTube video URL.
  2. Select the options you want.
  3. Click Generate Embed Code.
  4. Preview the player.
  5. Copy the generated HTML and paste it into your website.

Supported YouTube URL Formats

The generator supports standard YouTube watch URLs, youtu.be links, Shorts URLs, embed URLs and live URLs. URL parameters such as timestamps do not become part of the extracted video ID.

Responsive YouTube Embed Code

The responsive option creates a 16:9 container around the iframe so the player can scale to the width of its parent element. This is useful for responsive website layouts.

Privacy-Enhanced YouTube Embeds

Privacy-enhanced mode uses the youtube-nocookie.com domain for the embedded player. YouTube documents this as the privacy-enhanced mode for embedded players.

YouTube Embed Player Options

You can optionally set a starting time, autoplay and captions in the generated embed URL. The generator only adds the options you select.

Can Every YouTube Video Be Embedded?

No. A video owner can turn off embedding, and some videos may have age or other restrictions that prevent playback on third-party websites. The generator creates the embed code, but YouTube controls whether a particular video can actually play in an embedded player.

Frequently Asked Questions

Paste a YouTube video URL into the tool, choose your options and click Generate Embed Code. The generated HTML can then be copied into your website.

No. A YouTube video ID can be extracted from a supported URL and used to construct the standard embed URL without requesting data from the YouTube Data API.

Yes. Enable the responsive option to generate a 16:9 responsive container around the YouTube iframe.

Privacy-enhanced mode uses the youtube-nocookie.com embed domain. It is an option provided by YouTube for embedded players.

Yes. Enter the starting time in seconds and the generated embed URL will include the YouTube start parameter.

Yes. Enable the captions option to add the cc_load_policy=1 parameter to the generated embed URL.

The video owner may have disabled embedding, or the video may have age or other restrictions. The generator creates valid embed code, but playback availability is controlled by YouTube and the video owner.