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.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.Set times and options
Choose where the video starts and ends, then autoplay, mute, loop, captions, controls and the player size.
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.
Related tools
Subscribe Link Generator
A link and QR code that open a channel with the subscribe prompt.
Title and Description Checker
Check title and description length and preview the search result.
Title Capitalizer
Fix a title's capitals: title case, sentence case and more.
Title & Description Generator
Title ideas from real searches and a description template to fill in.
Tag Generator
Tags from what people actually search on YouTube, sized to fit the 500-character limit.
Hashtag Generator
Hashtags from real YouTube searches, with the three that show above your title.
More YouTube tools
Playlists
- Playlist length
- Study planner
- Course tracker
- Playlist to Excel
- Playlist to CSV
- Playlist to Text
- Playlist to Bookmarks
- Playlist to JSON
- Playlist to Markdown
- Playlist to XML
- Playlist to HTML
- Playlist to YAML
- Playlist to SQLite
- Playlist to Word
- Playlist to M3U
- Playlist to M3U8
- Playlist health
- Playlist analyzer
- Playlist links
- Playlist titles