Skip to content
T
Tools.Town
Free Online Tools for Everyone
<iframe>

YouTube Embed Code Generator

100% Free

Generate responsive YouTube embed code with autoplay, mute, loop and start-time options — copy-paste ready.

100% Secure
No Sign Up
Client-Side

Coming Soon

We're building YouTube Embed Code Generator right now. Drop your email and we'll notify you the moment it's live.

Generate the iframe embed code for any YouTube video — responsive, with the options you need. Here’s the exact pattern a good generator produces:

Basic embed

<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"
  allowfullscreen></iframe>

Replace VIDEO_ID with the part after watch?v= or youtu.be/.

Responsive embed (scales on mobile)

<div style="position:relative;padding-top:56.25%">
  <iframe src="https://www.youtube.com/embed/VIDEO_ID"
    style="position:absolute;inset:0;width:100%;height:100%"
    frameborder="0" allowfullscreen></iframe>
</div>

The 56.25% is the 16:9 aspect ratio (9 ÷ 16). Use 75% for 4:3.

Common parameters

ParameterEffect
autoplay=1Start playing on load (requires mute=1 in most browsers)
mute=1Start muted
start=90Begin at 90 seconds
loop=1&playlist=VIDEO_IDLoop the video (loop needs the playlist param)
controls=0Hide player controls
rel=0Limit “related videos” to the same channel

Append them to the embed URL with ? and join multiple with &, e.g. …/embed/VIDEO_ID?autoplay=1&mute=1&start=30.

The one-click generator that builds this from a pasted URL is being finished. Until then, copy a snippet above and swap in your video ID.

Frequently Asked Questions

How do I get the embed code for a YouTube video?
Take the video ID (the part after watch?v= or youtu.be/) and drop it into an iframe pointing at https://www.youtube.com/embed/VIDEO_ID. Wrap it in a responsive container so it scales on mobile. The pattern is shown below.
How do I make a YouTube embed responsive?
Wrap the iframe in a div with padding-top: 56.25% (16:9) and position the iframe absolutely to fill it. The embed then scales fluidly with the page width instead of using fixed pixel dimensions.
Can I autoplay or start a YouTube embed at a specific time?
Yes — append query parameters to the embed URL: ?autoplay=1&mute=1 (autoplay needs mute to work in modern browsers), and &start=90 to begin at 90 seconds. Combine them with &.

Related Tools You Might Like

Browse more free tools