UsTube

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.

Runs in your browser. Nothing you type or open here is uploaded.

How it works

How to embed a YouTube video

  1. 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. 2

    Pick your options

    Set a start time, autoplay, mute, loop, privacy mode and the width. Watch the preview change as you go.

  3. 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.

Video downloader

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.

Open the downloader Free to start · no card needed

Questions people ask

How do I embed a YouTube video in HTML?
Copy the iframe code this tool makes and paste it into the HTML of your page. The code contains the video's embed address and the settings you picked.
How do I make an embedded YouTube video autoplay?
Tick Autoplay and Mute. Browsers usually block autoplay with sound, so the video only starts by itself when it is muted.
How do I loop an embedded YouTube video?
Tick Loop. The tool adds loop=1 and repeats the video ID as the playlist, which a single video needs in order to loop.
What is the YouTube nocookie embed?
It is YouTube's privacy-enhanced mode. The embed uses the youtube-nocookie.com address, which does not store viewing information about a visitor until they play the video.
Can I start the embedded video at a certain time?
Yes. Type a time such as 1:30 or 90 in the Start at box. The tool turns it into seconds for the code.
Why does my embedded video show an error?
The owner may have turned off embedding, the video may be private or removed, or the link may be wrong. Try another video to check that your page works.
Free tools

More tools like this

See all 54 free tools