YouTube embed code generator

Paste a YouTube URL. Pick autoplay, mute, controls, start, end. We generate the complete <iframe> code, ready to drop into your blog, website, or marketing email. Embeds from youtube-nocookie.com by default for GDPR-friendly setups.

Want this automated for every Short? Try Reupload →

Frequently asked questions

How do I embed a YouTube video on my website?

Use an <iframe> tag with the YouTube embed URL: <iframe width="560" height="315" src="https://www.youtube.com/embed/<videoId>" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>. The tool above generates this with optional parameters (start, end, autoplay, mute, controls). Paste into any HTML page and the player loads.

What's the YouTube embed iframe code?

The standard format is <iframe src="https://www.youtube.com/embed/<videoId>?<params>" allow="..." allowfullscreen></iframe>. Replace <videoId> with the 11-character ID from the URL (e.g. dQw4w9WgXcQ). The allow attribute is required for autoplay to work in modern browsers. allowfullscreen lets viewers expand the player to full screen. The tool produces this exact format with your params filled in.

How do I embed a YouTube Short on my website?

Same as a regular video — use the standard /embed/ URL. YouTube Shorts ARE regular YouTube videos with a 9:16 aspect ratio; the embed player adapts. For best display, use a vertical aspect ratio in your iframe: width="315" height="560" works well. Or use width="100%" with aspect-ratio: 9/16 in CSS so the embed scales responsively.

How do I make a YouTube embed autoplay on page load?

Add ?autoplay=1 to the embed URL. Modern browsers (Chrome, Safari, Firefox) BLOCK autoplay with sound by default — to actually have it play, you must ALSO add ?mute=1. So the full param string for guaranteed autoplay is ?autoplay=1&mute=1. Once playing, the user can unmute manually. The toggle in the tool above sets both flags together.

How do I start a YouTube embed at a specific time?

Add ?start=<seconds> to the embed URL. For example, https://www.youtube.com/embed/dQw4w9WgXcQ?start=90 starts at 1m30s. To also stop at a specific time, add &end=<seconds>. The embed will play only the segment between start and end, then stop. The tool above generates these params from minute:second inputs.

What does youtube-nocookie.com do for embeds?

youtube-nocookie.com is YouTube's privacy-enhanced embed domain. Videos embedded from there don't set tracking cookies until the user interacts with the player (clicks play, clicks the title, etc). Same content, same player UI, but better for GDPR / cookie-banner compliance. Drop-in replacement for youtube.com — just swap the domain in the iframe src. Recommended for any embed on a public-facing site in EU jurisdictions.

How do I make a YouTube embed responsive?

Wrap the iframe in a container with padding-bottom: 56.25% (= 9/16) for landscape or 177.78% (= 16/9) for vertical Shorts. Set the iframe to position: absolute, top: 0, left: 0, width: 100%, height: 100%. Modern alternative: use the CSS aspect-ratio property — wrapper { aspect-ratio: 16 / 9; } and iframe { width: 100%; height: 100%; }. Both keep the player at the right ratio across all viewport sizes.

Can I hide the YouTube logo and video title in an embed?

Partially. ?modestbranding=1 reduces YouTube branding in the player (smaller logo, less promotional UI) but doesn't fully hide it — YouTube deprecated the full-hide option in 2018. ?showinfo=0 (hides title) was deprecated even earlier. For a fully clean look you'd need a third-party player wrapper or a self-hosted alternative; pure YouTube embeds always show some branding.