SEO Check Tools

YouTube Embed Code Generator

Paste a YouTube URL and generate clean iframe embed code with autoplay, mute, start/end time, loop, captions, controls, responsive layout, and privacy-enhanced youtube-nocookie mode.

  • Autoplay, mute, captions, loop, controls, and start/end time in one place.
  • Plain iframe or responsive 16:9 wrapper output.
  • Privacy-enhanced youtube-nocookie domain available.

Free browser-side tool. No signup. Your video URL is only used to build the embed code.

Generate YouTube embed code without editing iframe parameters by hand

YouTube's default Share > Embed button is fine for a basic iframe, but it is not built for people who need a specific player behavior. This free YouTube Embed Code Generator gives you the useful options in one place: autoplay, mute, controls, captions, loop, start time, end time, responsive sizing, and privacy-enhanced embeds.

Paste a video URL, choose the settings you want, preview the player, then copy the generated HTML into your website, CMS, blog post, documentation page, course page, or landing page.

What you can customize

Autoplay

Start playback automatically when the embed loads.

Mute

Required for reliable autoplay in modern browsers.

Start time

Begin the video at a specific second or mm:ss timestamp.

End time

Stop playback before the full video ends.

Controls

Show or hide the standard YouTube player controls.

Captions

Ask the player to show captions by default when captions are available.

Loop

Replay the same video using YouTube's required playlist parameter.

Related videos

Restrict recommendations to videos from the same channel where YouTube supports it.

Privacy-enhanced mode

Use youtube-nocookie.com instead of the standard YouTube embed domain.

Responsive layout

Wrap the iframe so it scales correctly on mobile and desktop.

Plain iframe vs responsive embed

PLAIN IFRAME

Drop-in HTML for any field

Use the plain iframe when your CMS already handles responsive video embeds or when a platform only accepts iframe HTML.

RESPONSIVE 16:9 WRAPPER

Scales cleanly on mobile and desktop

Use the responsive wrapper when you control the page HTML and CSS. It keeps the video at a stable 16:9 ratio, prevents layout overflow on mobile, and avoids the common problem where a fixed-width YouTube embed breaks a narrow page.

Autoplay, mute, and browser rules

Most modern browsers block autoplay when video starts with sound. That is why this tool pairs autoplay with mute. A muted autoplay embed is much more likely to work, especially inside landing pages, product pages, and documentation pages.

Autoplay can still vary by browser, device, power-saving mode, and user settings. For the most predictable experience, keep controls visible so the viewer can start playback manually if the browser blocks autoplay.

Privacy-enhanced YouTube embeds

Privacy-enhanced mode changes the iframe domain from youtube.com to youtube-nocookie.com. This can reduce cookie behavior before playback starts, which is useful for websites with stricter privacy expectations.

It is not magic compliance by itself. The YouTube player still loads external resources, and your site may still need the right consent or privacy disclosures depending on your audience and legal requirements.

Start time, end time, and loop behavior

Start and end times are converted into the parameters YouTube expects. You can enter seconds or timestamp-style values like 1:23.

Looping a single YouTube video has one awkward detail: YouTube requires the same video ID to be passed as the playlist parameter. The generator adds that automatically, so you do not have to remember the syntax.

How it works

  1. 1

    Paste a YouTube video URL, Shorts URL, youtu.be link, embed URL, or raw video ID.

  2. 2

    Choose player options: autoplay, mute, controls, captions, loop, related-video behavior, and privacy-enhanced mode.

  3. 3

    Add optional start and end times in seconds or mm:ss format.

  4. 4

    Pick plain iframe or responsive 16:9 wrapper.

  5. 5

    Preview the embed and copy the final HTML.

Tips for embedding YouTube on a page

Embed the video where it actually helps the page

A YouTube embed should support the page's purpose. Put demos near product explanations, tutorials near step-by-step instructions, and testimonials near proof sections. A video buried at the bottom of a page rarely gets watched.

Keep the surrounding page fast

YouTube embeds can add weight to a page. If performance matters, avoid stacking many embeds on one page, use one primary video per section, and consider lazy-loading embeds inside your site template.

Use a responsive wrapper for mobile traffic

Fixed-size iframes often look fine on desktop and break on mobile. A responsive wrapper keeps the player inside the viewport and makes the embed usable across phones, tablets, and wide screens.

Do not rely on embeds alone for SEO context

Search engines still need readable page content around the video. Add a clear heading, short summary, transcript excerpt, or supporting copy so the page has context beyond the iframe.

Frequently asked

Is this YouTube Embed Code Generator free?
Yes. The tool is free and does not require signup. Paste a YouTube URL, choose your options, preview the player, and copy the generated HTML.
What YouTube URLs can I paste?
You can paste standard watch URLs, youtu.be short links, Shorts URLs, embed URLs, or a raw YouTube video ID.
Can I make a responsive YouTube embed?
Yes. Choose the responsive wrapper output when you want the video to scale with the page width and keep a 16:9 aspect ratio on mobile and desktop.
How do I embed a YouTube video with autoplay?
Turn on autoplay in the generator. For better browser support, keep mute enabled too. Most browsers block autoplay with sound.
Why does autoplay require mute?
Browsers restrict videos that start automatically with sound because they are disruptive. Muted autoplay is allowed more often, though final behavior still depends on the viewer's browser and device settings.
How do start and end times work?
The generator converts your timestamp into YouTube embed parameters. You can enter seconds, such as 90, or timestamp format, such as 1:30.
How do I loop a YouTube embed?
Enable loop. The generator adds the required loop parameter and the matching playlist parameter, which YouTube needs when looping a single video.
What is youtube-nocookie.com?
It is YouTube's privacy-enhanced embed domain. It can reduce cookie behavior before playback starts, but it does not remove all external YouTube requests or replace your site's privacy obligations.
Can I hide related videos completely?
No. YouTube no longer lets embeds fully hide related videos. The available option restricts related videos more narrowly, usually toward the same channel, when supported by YouTube.
Does this work with YouTube Shorts?
Yes. Paste a Shorts URL and the tool extracts the video ID for the embed code. The embed output still uses YouTube's standard iframe player.
Plain iframe or responsive wrapper: which should I use?
Use plain iframe if your CMS already makes videos responsive. Use the responsive wrapper if you are pasting into your own HTML and want the embed to resize cleanly on mobile.
Do you store the video URL I paste?
No. The tool only uses the URL to extract the video ID and generate the embed code.

Ready to build your YouTube embed code?

Paste a video URL and pick the options you need. The HTML is ready to copy in seconds.