YouTube Tools

YouTube Embed Code Generator

Make the embed code for any video, set where it starts and stops, choose the player options and see a live preview.

How to use the Embed Code Generator

  1. 01

    Paste the video link

    Any video link works. If it already has a time in it, like ?t=90, that becomes the start time.

  2. 02

    Set times and options

    Choose where the video starts and ends, then autoplay, mute, loop, captions, controls and the player size.

  3. 03

    Copy the code

    Copy the iframe code into your website, blog or page builder. The preview shows exactly what visitors will see.

How start and end times work

YouTube's player reads the start and end times from the embed link in whole seconds. The generator turns times like 1:30 or 1m30s into seconds for you, and checks them against the video's length so the clip isn't empty.

Privacy-enhanced mode loads the player from youtube-nocookie.com, so YouTube doesn't store information about visitors who don't play the video. If the video's owner has turned off embedding, the tool tells you before you publish the code.

Frequently asked questions

How do I embed a YouTube video at a specific time?

Paste the video link, type the start time (for example 1:30) and copy the code. The embed link gets a start parameter in seconds, so the player begins there.

Can I make an embedded video stop at a certain time?

Yes. Set an end time and playback stops there. The end time has to be after the start time.

Why doesn't autoplay work?

Most browsers block videos that play sound on their own. Turn on Start muted along with Autoplay and the video will start by itself.

How do I make the embed responsive?

Choose Responsive. The code sets the player to the full width of its container with a 16:9 shape, so it fits phones and desktops without extra CSS.

What is privacy-enhanced mode?

It serves the player from youtube-nocookie.com. YouTube doesn't store information about visitors to your page unless they play the video.

More YouTube tools

See all tools