YouTube Embed Code Generator
Get the HTML to embed a YouTube video: responsive or fixed size, start and stop times, privacy-enhanced address, and autoplay options. Free, no signup.
Watch links, youtu.be links, Shorts and live links all work.
Starting points
Paste a YouTube link to get the embed code.
Before you publish
- Paste the code into the HTML of your page. Some website builders remove iframes, so use their “embed” or “custom HTML” block.
- Autoplay is controlled by the viewer’s browser, and many block it, especially on phones. Do not rely on it.
- Private videos, and some videos the owner has not allowed to be embedded, will not play in an embed. Unlisted videos do play.
- The privacy-enhanced address reduces cookies until a viewer plays the video. It does not make a page compliant with privacy law, which depends on your site.
- Embedding a video that is not yours is allowed only when the owner has allowed embedding. Check before you use it.
Related Tools
Link Generator
Build YouTube links: short link, link that starts at a time, playlist link, channel link, and subscribe link. Open each to test it. Free, no signup.
Chapters Builder
Check your YouTube chapter timestamps against YouTube’s rules, fix problems line by line, and copy a clean list for your description. Free, no signup.
Video File Size Calculator
Estimate the file size of a video from its length, resolution and frame rate, and how long it takes to upload at your speed. Free, no signup.
SRT Toolkit
Shift subtitle timing, merge SRT files, and clean up captions in your browser. Fix out-of-sync subtitles for YouTube. Files stay on your device. Free.
About the YouTube Embed Code Generator
?What the embed code generator does
You paste a YouTube link and choose how the player should behave, such as where it starts, whether it is responsive, and whether it uses the privacy-enhanced address. The tool writes the HTML code that puts the player on your page.
It builds code only. It does not host the video or change what YouTube allows. The code is built in your browser, and nothing is requested from YouTube until you choose to load a preview.
→How to embed a YouTube video in 4 steps
Paste the video link
A watch link, a youtu.be link, a Shorts link or the 11-character video ID.
Set the start and stop times
Optional. Use minutes and seconds like 1:30, or seconds.
Choose the options
Responsive or fixed width, the privacy-enhanced address, controls, autoplay, muting, looping and related videos.
Copy the code into your page
Paste it into the HTML of your page, in a custom HTML block if you use a website builder. Load a preview first if you want to check it.
✓What is in the tool
Start and stop times
Begin or end the video at a moment you choose.
Responsive or fixed
A 16:9 box that fills the page width, or a fixed width you set.
Privacy-enhanced address
Uses youtube-nocookie.com, which sets fewer cookies until a viewer plays.
Plain-language options
Autoplay, mute, loop, controls and related videos, each with a note.
Preview on request
The real player loads only when you press the button.
One-click copy
Copy the finished code.
★Examples
A video on a blog page
Responsive and privacy-enhanced.
Example:
The code wraps the player in a 16:9 box and points to youtube-nocookie.com, so the video fits any screen width.
Start in the middle
Set a start time of 2:10.
Example:
The address gets start=130, so the video begins 2 minutes 10 seconds in.
A looping clip
Choose Play again at the end.
Example:
The tool adds loop=1 and the playlist parameter that the player needs to loop a single video.
♥Limits to know about
Autoplay is not guaranteed
The viewer’s browser decides, and many block it.
Not privacy advice
The privacy-enhanced address reduces cookies but does not make a site compliant by itself.
Only embeddable videos
Private videos and videos with embedding switched off will not play.