Skip to main content
Responsive embeds Shorts and playlist support Live preview One-click copy

Supports: youtube.com/watch, youtu.be, youtube.com/shorts, youtube.com/playlist, or a video ID

Player Options
Appearance
Size
Start / End Time
minutes seconds
minutes seconds

Leave empty to play from the beginning / to the end.

A YouTube embed code is a snippet of HTML that displays a YouTube video player on any website. This free generator creates custom embed codes with responsive sizing, autoplay, loop, privacy-enhanced mode, start/end timestamps, and support for Shorts and playlists. Paste any YouTube URL, customize the player options, and copy the code. No signup required.

How to Embed a YouTube Video on Your Website

1

Paste Your URL

Copy the URL of any YouTube video, Shorts, or playlist and paste it into the input field above.

2

Customize Options

Choose responsive sizing, autoplay, loop, privacy mode, start/end time, and more. See a live preview instantly.

3

Copy and Paste

Click "Copy Code" and paste the HTML into your website, blog, WordPress, or any CMS. Done.

What is a YouTube Embed Code?

A YouTube embed code is an HTML <iframe> element that loads the YouTube video player inside your web page. When a visitor views the page, the embedded player loads the video directly from YouTube's servers, so you do not need to host the video file yourself.

The embed code format uses YouTube's IFrame Player API, which supports dozens of parameters for customizing playback behavior, appearance, and privacy settings. Our generator handles all of these parameters visually.

Why Responsive Embeds Matter

A standard YouTube iframe has fixed pixel dimensions. On a mobile phone or tablet, this can cause the video to overflow the screen. A responsive embed wraps the iframe in a container that scales proportionally to any screen width.

Our generator uses a CSS padding-bottom technique that maintains the 16:9 aspect ratio (or 9:16 for Shorts) regardless of screen size.

Privacy-Enhanced Mode and GDPR Compliance

When you enable privacy-enhanced mode, the embed code uses youtube-nocookie.com instead of youtube.com. YouTube does not store tracking cookies on your visitor's browser until they actually click play.

How Autoplay Works in 2026

Modern browsers block autoplay for videos with audio. For autoplay to work reliably, the video must also be muted. Our generator automatically enables mute when you toggle autoplay.

YouTube Embed Parameters Reference

ParameterValuesDescription
autoplay0 or 1Automatically start playing the video
mute0 or 1Mute the video (required for autoplay)
loop0 or 1Replay the video when it ends
controls0 or 1Show or hide player controls
modestbranding0 or 1Hide the YouTube logo in the control bar
rel0 or 1Show related videos from same channel (0) or all (1)
startsecondsStart playback at a specific time
endsecondsStop playback at a specific time
colorred or whiteProgress bar color
disablekb0 or 1Disable keyboard shortcuts
cc_load_policy0 or 1Show closed captions by default
playsinline0 or 1Play inline on iOS instead of fullscreen

Embedding YouTube Shorts

YouTube Shorts use a vertical 9:16 aspect ratio. When you paste a Shorts URL, the generator automatically adjusts the embed dimensions to display the Short correctly with a vertical player.

Embedding YouTube Playlists

You can embed an entire YouTube playlist by pasting a playlist URL. The embedded player will display the first video and include navigation controls for browsing all videos.

Frequently Asked Questions

How do I embed a YouTube video on my website?

Paste your YouTube video URL into the generator above and customize the options. Click "Copy Code" and paste the generated HTML iframe code into your website.

What is the YouTube embed code format?

YouTube embed codes use an HTML iframe element: <iframe src="https://www.youtube.com/embed/VIDEO_ID"></iframe>. Our generator adds responsive wrappers and parameters.

How do I make a YouTube embed autoplay?

Toggle the "Autoplay" option. This adds autoplay=1 to the embed URL. Most browsers require the video to also be muted.

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

Use the "Start Time" field to set where the video should begin. You can also set an "End Time" to stop playback at a specific point.

What is YouTube privacy-enhanced mode?

Privacy-enhanced mode uses youtube-nocookie.com instead of youtube.com. YouTube will not store cookies unless the visitor plays the video. This helps with GDPR compliance.

Can I embed YouTube Shorts?

Yes. Paste any Shorts URL and the generator automatically detects the format and generates a vertical embed with the correct 9:16 aspect ratio.

How do I make a YouTube embed responsive?

Toggle the "Responsive" option. This wraps the iframe in a container that scales to fit any screen width while maintaining the correct aspect ratio.

Can I embed a YouTube playlist?

Yes. Paste a playlist URL and the generator creates embed code that plays through all videos with next/previous controls.

More Free YouTube Tools

Growing a YouTube Channel?

Embed codes get your videos on other websites, but real growth comes from creator collaborations. CollabPals connects you with 150,000+ YouTube creators for organic, free collaborations.

Start Growing on CollabPals (Free)