YouTube Embed Code Generator

Generate custom YouTube embed codes for your website. Control player size, autoplay, loop, and more. Free HTML iframe generator.

Size Preset
Player Options

How to Use Embed Code Generator

  1. 1 Paste your YouTube video URL
  2. 2 Customize player settings (size, autoplay, etc.)
  3. 3 Copy the generated embed code
  4. 4 Paste the code into your website HTML

What You Get

Generates HTML iframe code to embed YouTube videos on any website. Supports custom dimensions, autoplay, loop, controls visibility, and more.

Input: Standard embed

Output: <iframe width="560" height="315" src="..."></iframe>

Input: Autoplay + loop

Output: <iframe ... autoplay=1&loop=1></iframe>

Input: Responsive embed

Output: A responsive iframe wrapper that scales to your container width

What is an embed code?

An embed code is HTML that displays a YouTube video player directly on your website. Visitors can watch without leaving your page.

Will autoplay work?

Most browsers require videos to be muted for autoplay to work. Enable both autoplay and mute for reliable auto-playing.

Can I use custom sizes?

Yes! You can set any width and height. Use responsive embeds (100% width) for layouts that resize automatically.

How do I make the embed responsive?

Enable the responsive option (100% width). This wraps the iframe in a container that preserves the 16:9 aspect ratio while scaling to the parent element.

Why does autoplay sometimes not start?

Autoplay is often blocked unless the video is muted. Turn on both autoplay + mute to maximize compatibility across browsers and mobile devices.

100% client-side. No data is sent to any server.