YoutubeTools.Live
Creator tools / Video publishing

YouTube Embed Code Generator

Turn a video, Short or playlist link into a responsive HTML player. Choose its shape and start time, preview the result, then copy the iframe into your website.

Set up your player

Use seconds or minutes:seconds. Leave empty to keep the link’s timestamp.

Player preview

Your player appears here after you generate the code.

How to embed a YouTube video on your website

  1. Copy the video’s Share link or the address from your browser. To embed a series, copy its playlist URL with the list parameter.
  2. Paste the link above. Give the player a short, descriptive title that tells a screen reader user what they can play. For a lesson on lighting, “Portrait lighting demonstration” is more useful than “Video 1”.
  3. Generate the code. Play the preview to check the video and starting point. Copy the entire iframe, including its closing tag.
  4. Paste it into the body of your HTML page where you want the video to appear. In a blog editor, use a Custom HTML or embed-code block. A paragraph or code-display block may print the markup as text.

Preview the published layout at phone and desktop widths. The generated player fits its parent column, so you can use the same snippet in a full-width lesson or a narrower article.

Embed YouTube Shorts in a vertical player

Paste the Shorts sharing address, such as youtube.com/shorts/VIDEO_ID. Auto-detect selects a 9:16 frame for that URL. A shortened youtu.be link carries the video ID but does not identify the video as vertical. Choose Portrait yourself in that case.

A vertical frame can take up a lot of space on a wide screen. The portrait snippet caps the width at 360 pixels and centers the player. On smaller screens it shrinks to fit. Changing the frame shape affects the space on your page. The source video keeps its original framing.

Start an embed at a particular moment

Suppose the demonstration begins at 1 minute 35 seconds. Enter 1:35 and the generator writes start=95 into the player URL. An explicit time overrides a timestamp in a shared link. Enter zero to open at the beginning. The start setting leaves the rest of the video available to the viewer.

Choose between a video and a playlist embed

For a single tutorial, copy its watch URL. If that URL includes a playlist ID too, the player keeps the selected video and its playlist context. To open the playlist from its beginning, use its dedicated /playlist?list=… link. This is useful for a course index where you want viewers to move between lessons.

Privacy-enhanced mode and autoplay

Privacy-enhanced mode uses YouTube’s youtube-nocookie.com player domain. Loading the player still connects the visitor’s browser to YouTube. To let readers choose when to start, leave autoplay unchecked. If you request autoplay, browsers may still require a tap, especially for playback with sound.

YouTube’s embedded player parameter reference

Embed code questions

Why does my editor show the iframe as text?

Switch to an HTML block, paste the code again, and check the page preview. If your editor accepts only a URL, use the original YouTube share link in its video block. Some hosted editors restrict iframe markup by plan or user role.

Why is the player visible but the video unavailable?

Open the original video on YouTube and check its visibility and embedding permissions. Private videos, age restrictions and an owner’s embedding settings can limit playback. Test from a hosted page or a local HTTP server when checking your snippet.

Can I use this embed code for a YouTube channel?

Choose a public playlist from the channel and paste its playlist link to display a collection. A channel homepage or @handle alone does not identify the video or playlist to play.

Do I upload the video file to my hosting?

Only the iframe HTML goes into your page. YouTube hosts and delivers the video. If you replace the video with a new upload, generate a snippet for its new URL.