YouTube Embed Code Generator
Paste a YouTube link, choose your options and copy the HTML. The preview below is the real player, so you see what your visitors will see.
The preview does not autoplay, so it will not start playing by itself while you change options.
Runs in your browser. Nothing you type or open here is uploaded.
How to embed a YouTube video
- 1
Paste the video link
Copy the link from the Share button on YouTube and paste it in the box. A short youtu.be link or a Shorts link works too.
- 2
Pick your options
Set a start time, autoplay, mute, loop, privacy mode and the width. Watch the preview change as you go.
- 3
Copy the code
Press Copy code and paste it into the HTML of your page, blog post or website builder.
What the options do
This tool writes a standard YouTube iframe and adds the player settings you choose as parameters in its address.
- Start at. Adds a start time in seconds, so the video begins at the part you want.
- Autoplay. Starts the video when the page loads. Most browsers only allow this when the sound is muted, so tick Mute as well.
- Mute. Starts the video without sound.
- Loop. Plays the video again when it ends. YouTube needs the video's own ID repeated as a playlist for a single video to loop, and the tool adds that for you.
- Hide player controls. Removes the play bar. Viewers can then still click to pause, but have less control.
Privacy mode
With privacy mode on, the code points to youtube-nocookie.com instead of youtube.com. YouTube describes this as privacy-enhanced mode: it does not store viewing information about visitors until they play the video. If your site serves visitors who expect a cookie notice, this is the safer default, though you should still check what your own rules require.
A responsive player
A fixed-size iframe does not shrink on a phone. The responsive wrapper keeps the 16:9 shape and scales with the width of its container. The width you enter becomes the largest size the player will reach. Turn the wrapper off if you want a plain iframe with a set width and height.
Where to paste the code
Paste it into any place that accepts HTML: a blog post in HTML mode, a page builder's HTML block or your own template. Some editors strip iframes for safety. If yours does, look for a built-in video or embed block instead.
Good habits for embeds
- Do not autoplay with sound. Visitors dislike it and browsers block it.
- Embed only videos you own or that the owner allows to be embedded.
- Give the page text around the video, so people and search engines know what it is about.
Need the thumbnail for a link preview or a poster image? The YouTube thumbnail downloader saves it in full HD. To send people straight to one moment instead of embedding, use the YouTube timestamp link generator.
Need the video file first?
Paste a link from TikTok, Instagram, Facebook or X and save it in HD with no watermark and no ads.