100% FREE

YouTube Video Embed Code Generator

Turn any YouTube link into ready-to-paste embed code, with size and player options and a live preview. No signup.

Embed Code Generator

Paste a video link, customize the player, and copy a ready-to-use embed code — with a live preview as you go.

Works with regular links, youtu.be links, Shorts links, or just the video ID.
Sizing
Player options
Privacy-enhanced mode (youtube-nocookie.com) avoids setting cookies until the viewer plays the video.
▶ Paste a YouTube link to see a live preview here.

Generates a standard YouTube iframe embed — the officially supported way to show YouTube videos on another site. Autoplay only works in most browsers when the video is also muted, so muting is applied automatically when autoplay is on. The preview never autoplays.

What Is the YouTube Video Embed Code Generator?

The YouTube Video Embed Code Generator is a free tool that turns any YouTube link into a ready-to-paste embed code. Paste a video link, adjust the sizing, playback and privacy options, and copy the finished code with a live preview showing exactly how it will look.

It’s free with no sign-up, and everything is generated in your browser.

How to Use the Embed Code Generator

Paste your video link. Regular links, youtu.be links, Shorts links or a plain video ID all work.
Choose your sizing. Pick Responsive so the player resizes with the page, or Fixed size and set a width and height.
Set an aspect ratio. Choose 16:9, 4:3, 1:1 or 9:16 depending on the video.
Set start and end times if needed. Use mm:ss to trim which part of the video plays.
Toggle your playback options. Turn autoplay, mute, loop, controls, fullscreen and more on or off.
Check the live preview. It updates as you change any setting.
Click “Copy code”. Paste the result into your site’s HTML.

Sizing Options

OptionWhat it does
ResponsiveThe player scales to fit its container, so it looks right on any screen size
Fixed sizeYou set an exact width and height in pixels
Aspect ratioChoose 16:9 for standard video, 4:3 for classic video, 1:1 for square, or 9:16 for Shorts and vertical video

Use Responsive for most website embeds, since it adapts automatically to mobile and desktop. Use Fixed size when you need the player to match an exact space in your layout.

Playback Options

OptionWhat it does
Start timeSets where playback begins, in mm:ss
End timeSets where playback stops, in mm:ss
AutoplayStarts the video automatically when the page loads
MuteStarts the video muted
Loop videoReplays the video automatically when it ends
Show controlsDisplays the play bar, volume and settings
Allow fullscreenLets viewers expand the player to fullscreen
Disable keyboard shortcutsTurns off keyboard control of the player
Show related from any channelControls whether related videos can come from other channels when the video ends
Show captions by defaultTurns captions on automatically, if available

Why Autoplay Needs Mute

Most browsers block autoplay with sound to stop pages from playing audio without permission. The tool automatically applies mute whenever autoplay is turned on, so your embed will actually autoplay instead of being blocked.

Privacy and Display Options

OptionWhat it does
Privacy-enhanced modeUses youtube-nocookie.com, so YouTube doesn’t set cookies on a visitor’s browser until they press play
Progress bar colorChoose red (YouTube’s default) or white
Player languageSets the language used for player controls and interface text

Privacy-enhanced mode is worth turning on if your site has a cookie policy or you want to reduce tracking before a visitor chooses to watch.

What Kind of Code Does It Generate?

The tool outputs a standard YouTube iframe embed, which is the officially supported way to place a YouTube video on another website.

It isn’t a video download or a copy of the file. It’s a small piece of HTML that loads the player directly from YouTube, so the video continues to count views and follow YouTube’s terms on the creator’s channel.

Where to Paste the Embed Code

  • WordPress: a Custom HTML block, or a Text/Code widget
  • Elementor: an HTML widget
  • Plain HTML site: directly into the page where you want the player
  • Website builders: look for an “Embed”, “HTML” or “Code” element

Tips for Embedding YouTube Videos

  • Use Responsive sizing for most pages, so the player fits phones, tablets and desktops.
  • Match the aspect ratio. Use 9:16 for Shorts and 16:9 for standard uploads.
  • Only autoplay when it fits the page. It can be disruptive on content-heavy pages.
  • Use privacy-enhanced mode if you’re cookie-conscious.
  • Set start and end times to show a highlight from a longer video.
  • Keep fullscreen enabled. Most viewers expect it.

Who Is This Tool For?

  • Website owners and bloggers adding videos to pages and posts
  • Marketers embedding product demos, testimonials or ads
  • Developers who want a correct embed without writing the iframe by hand
  • Educators embedding lesson or lecture videos with a set start and end time

Why Use This Tool?

  • Free. No account and no limits.
  • Full control over the player. Sizing, playback, privacy and language options in one place.
  • Live preview. See exactly how the embed will look before you copy it.
  • Standard, supported code. Uses YouTube’s official iframe embed method.
  • Privacy option included. Enable the cookie-reduced embed mode with one toggle.

Frequently Asked Questions

Is the YouTube Video Embed Code Generator free?

Yes. It’s completely free, with no registration required.

What kind of embed code does it generate?

A standard YouTube iframe embed, which is YouTube’s officially supported method for showing videos on other websites.

Why does autoplay turn on mute automatically?

Most browsers block videos from autoplaying with sound. Muting the video is what allows autoplay to actually work.

What is privacy-enhanced mode?

It’s an embed mode that uses youtube-nocookie.com instead of youtube.com, so YouTube doesn’t set cookies on a visitor’s browser until they press play.

Can I embed just part of a video?

Yes. Set a start time and, if needed, an end time in mm:ss to control which section plays.

Does embedding a video affect the creator’s views or monetization?

No. An embedded video still plays through YouTube’s player and counts toward the video’s views and ads on the original channel.

Can I embed a YouTube Short?

Yes. Paste the Shorts link and choose the 9:16 aspect ratio for a vertical player.

What’s the difference between Responsive and Fixed size?

Responsive scales the player to fit its container automatically. Fixed size locks the player to an exact width and height that you set.

Where do I paste the code on my website?

Anywhere your site accepts HTML, such as a Custom HTML block in WordPress or an HTML widget in Elementor.

Do I need permission from the video owner to embed it?

No, as long as the video’s owner allows embedding, which is the default setting for most public YouTube videos. If embedding is disabled by the creator, the video won’t play through this method.

Generate Your Embed Code Now

Paste a video link, adjust the settings, and copy the embed code for your site.

↑ Back to the Tool

Related Tools