Skip to content

How to Get the Embed Code on YouTube (Copy in 5 Steps)

How to Get the Embed Code on YouTube (Copy in 5 Steps)
Where is the embed code on YouTube and how to copy it

Need the embed code for a YouTube video?

Here's the quick answer: click Share under the video. Then click Embed. Then hit Copy.

That's it. Your code is ready to paste.

In this guide, you'll learn:

  • Where to find the embed code
  • How to paste it into WordPress or any site
  • How to make the video responsive
  • How to fix common embed problems

What Is a YouTube Embed Code?

An embed code is a small piece of HTML.

It uses an <iframe> tag. This tag shows a YouTube video right on your page.

Visitors can watch without leaving your site. That keeps them on your page longer. And longer visits are a good sign for SEO.

Where Is the Embed Code on YouTube?

It's hidden behind the Share button.

Open any video. Look under the player. Click Share. You'll see an Embed icon. Click it, and the code appears.

How to Copy a YouTube Embed Code (5 Steps)

  1. Go to YouTube. Open youtube.com on your computer.
  2. Open your video. It can be yours or someone else's.
  3. Click Share. It sits right under the video.
  4. Click Embed. A box with your HTML code will pop up.
  5. Click Copy. Then paste it into your site's HTML.

Pro tip: Tick the Start at box to begin the video at a set time. Great for long videos.

Example of a YouTube Embed Code

Here's what the code looks like:

<iframe width="560" height="315"
src="https://www.youtube.com/embed/VIDEO_ID"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen></iframe>

Replace VIDEO_ID with your video's ID. It's the text after v= in the YouTube link.

How to Add the Embed Code to Your Site

WordPress

Add a Custom HTML block. Paste the code. Hit Preview.

Even easier: paste the plain YouTube link on its own line. WordPress embeds it for you.

Blogger

Switch the post editor to HTML view. Paste the code where you want the video.

Any Other Site

Paste the code into your page's HTML. Save. Done.

How to Make Your YouTube Video Responsive

The default code has a fixed width. On phones, that can break your layout.

Fix it with this CSS:

.video-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

Then wrap your iframe like this:

<div class="video-wrap">
  <iframe src="https://www.youtube.com/embed/VIDEO_ID" allowfullscreen></iframe>
</div>

Now your video fits every screen.

Embed Not Working? Try This

  • No Embed option? The owner may have turned embedding off. You can't embed that video.
  • Private video? Private videos can't be embedded. Set it to Public or Unlisted.
  • On your phone? The YouTube app has no Embed button. Use a computer or your browser's desktop mode.
  • Video blank? Check that you pasted in HTML mode, not visual mode.

FAQ

Is it free to embed YouTube videos?

Yes. It's 100% free.

Does embedding help SEO?

It can. Videos boost engagement and time on page. Both help your content perform better.

Can I embed someone else's video?

Yes, if the owner allows embedding. Most do.

Final Thoughts

Finding the YouTube embed code is simple. Share → Embed → Copy.

Paste it. Make it responsive. Your page now looks better and keeps readers longer.

Next up: how to add a lazy-loading YouTube video to speed up your blog. Stay tuned.

Written by

MNM is a blogging expert with over 10 years of experience. Since 2020, he has been a top destination for bloggers to find tips and growth strategies for their blogs. The content created by MNM is clear and of high quality, especially for those who want to begin their blogging journey.

Share X Facebook