ZapKit

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.

What is a YouTube embed code generator?

An embed code generator writes the iframe code that puts a YouTube video on a website, blog or course page, with the options you choose already set. YouTube's own Share, Embed dialog offers a start time and little else.

Here you can set both a start and an end time, so only a clip plays, and switch on autoplay, muting, looping, captions, hidden controls or privacy-enhanced mode. The player can be a fixed size or responsive, filling the width of its container at 16:9. A live preview shows exactly what visitors will see, and the tool warns you if the video's owner has turned off embedding, before you publish code that won't play.

How to use the Embed Code Generator

  1. 1.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. 2.Set times and options

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

  3. 3.Copy the code

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

Example: play only 1:30 to 2:45

For a video with the ID VIDEO_ID, a start of 1:30, an end of 2:45 and captions on:

Start
90 seconds
End
165 seconds
Clip length
75 seconds
Player URL
https://www.youtube.com/embed/VIDEO_ID?start=90&end=165&cc_load_policy=1

The embedded player starts at 1:30 and stops at 2:45. Privacy-enhanced mode swaps the domain for youtube-nocookie.com.

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