YouTube Embed Code Generator

Create responsive YouTube embed code with start time, autoplay, mute, loop and privacy-enhanced mode, and copy the finished iframe.

About YouTube Embed Code Generator

The YouTube Embed Code Generator builds the HTML to put a YouTube video on your website, responsive and ready to paste.

Options

Start time, autoplay, mute, loop and showing or hiding controls.

Privacy-enhanced mode

On by default, using youtube-nocookie.com as YouTube recommends for fewer cookies.

Responsive

The video scales to fit phones and desktops.

Autoplay tip

Most browsers only autoplay muted videos, so turn on mute with autoplay.

Copy or download

Copy the code or save it as a .txt file. Check the page on a phone and a desktop afterwards.

Private

Everything runs in your browser. Nothing is uploaded.

Embed not working?

The owner may have turned off embedding, or the video is private, age-restricted or blocked in some countries. Also check the code uses the /embed/ address, not the normal watch link.

Looping one video

For a single video, loop=1 only works together with playlist= set to the same video ID.

How to use YouTube Embed Code Generator

  1. Paste the YouTube video link.
  2. Set the start time and choose the options.
  3. Copy the generated code.
  4. Paste it into your web page.

Help & FAQ

What is privacy-enhanced mode?

It serves the video from youtube-nocookie.com. YouTube's help says this keeps views of the embedded video from influencing the visitor's browsing and ad personalisation. It is available only for embedded players on websites.

Why does autoplay start muted?

Browsers generally block autoplay with sound, so the tool adds mute=1 when autoplay is on. The visitor can turn the sound on in the player.

What does responsive mean?

The iframe sits in a box that keeps a 16:9 shape and scales with the width of its container, so it fits phones and desktops. Without it you get a fixed 560 by 315 pixel player.

Which kinds of link can we paste?

Watch, youtu.be, Shorts, live, embed and mobile links, and a bare 11-character video ID. Playlist links and other sites give no code.

How do we make a video loop?

Tick Loop. The tool adds loop=1 and sets the playlist parameter to the same video ID, which YouTube documents as the way to loop one video. Looping has limited support in embeds, so test it.

How do we start at a certain time?

Type the number of seconds in Start at, for example 90 for 1 minute 30 seconds. A time in the pasted link is ignored.

Can we enter a negative or decimal start?

The tool will write them, but a negative value is not valid. A decimal such as 1.9 is cut to 1. Use whole seconds from 0 upward.

Why does our embedded video show an error?

The owner may have disabled embedding, the video may be age-restricted, private or deleted, or the link may be wrong. Test the link on YouTube first.

Does the code slow our page?

An iframe loads the YouTube player, which adds requests and weight. Loading it below the fold or after a click keeps the page lighter.

Does Clear remove the link too?

No. It empties the generated code only, and the link stays in the box. Select the link and delete it yourself.

Can we add captions or other player options?

Not in this tool. YouTube documents more parameters, such as captions, and you can add them to the address by hand.

Is our link stored or uploaded?

No. The code is built in your browser and nothing is sent anywhere.

More in Creator Tools

See all 14 in Creator Tools