Paste a URL
Drop in any YouTube watch, Shorts, playlist or youtu.be link. We auto-detect what kind of embed you need.
Drop in any YouTube watch, Shorts, playlist or youtu.be link. We auto-detect what kind of embed you need.
Toggle autoplay, mute, loop, captions and 15+ other player options. The live iframe preview updates as you go.
Copy the clean HTML iframe with one click and paste it into your blog, docs, landing page or CMS.
Autoplay, loop, controls, captions, start/end, keyboard, related videos, plus the widely used (but undocumented) mute option, all in one UI
The preview panel updates instantly as you toggle options — see exactly what visitors will see
Auto-detects the target from the URL. Shorts get a 9:16 wrapper; playlists get listType=playlist automatically
One toggle switches to youtube-nocookie.com, so YouTube won't use the view to personalize the viewer's browsing
Modern aspect-ratio HTML wrapper — no deprecated padding-bottom hack, no fixed pixel sizes
All embed-URL construction runs client-side. One YouTube meta call for the preview card, that's it
A YouTube embed code generator, or any youtube iframe generator, is mostly a friendly way to write query parameters on the end of an embed URL. These are the youtube embed parameters Google documents for the IFrame player today, plus the ones it has retired. start and end take whole seconds counted from the beginning of the video.
| Parameter | Values | What it does |
|---|---|---|
| autoplay | 0 or 1 | Starts playback when the player loads |
| cc_load_policy | 1 | Shows captions by default |
| cc_lang_pref | Language code | Default caption language |
| color | red or white | Color of the progress bar |
| controls | 0 or 1 (default) | 0 hides the player controls |
| disablekb | 1 | Turns off keyboard controls |
| enablejsapi | 1 | Allows control through the IFrame API |
| end | Seconds | Time to stop playing |
| fs | 0 | Hides the fullscreen button |
| hl | Language code | Language of the player interface |
| iv_load_policy | 1 or 3 | 3 hides video annotations |
| list, listType | ID, playlist or user_uploads | Loads a list instead of one video |
| loop | 1 | Repeats playback; one video also needs playlist set to its own ID |
| origin | Your domain | Used together with enablejsapi |
| playlist | Video IDs, comma separated | Videos to play after the first |
| playsinline | 0 or 1 | On iOS, 1 plays in the page, 0 plays fullscreen |
| rel | 0 or 1 | 0 limits related videos to the same channel |
| start | Seconds | Time to start playing |
| widget_referrer | Page URL | Tells YouTube Analytics where the player is |
| modestbranding | Deprecated | No effect since August 15, 2023 |
| showinfo | Removed | Dropped from the docs in 2020 |
| Source: Google for Developers: YouTube embedded player parameters · data as of | ||
Two details trip people up. Since September 25, 2018, rel=0 no longer removes related videos; it only limits them to your channel. And mute=1, which the tool above offers as "Muted at start", is not on Google's parameter list. It is widely used and the generator includes it, but the only documented way to mute is the IFrame API's mute method. The "Modest branding" toggle is kept for old embeds and does nothing today.
The default embed snippet has a fixed width and height, which overflows on a phone or looks tiny in a wide article. A responsive youtube embed lets the player fill its container and keeps the shape. Google does not publish CSS for this. Its documentation only gives size limits for the player itself:
<div style="position:relative; width:100%; aspect-ratio: 16 / 9;">
<iframe
style="position:absolute; inset:0; width:100%; height:100%;"
src="https://www.youtube-nocookie.com/embed/VIDEO_ID?playsinline=1"
title="Video title"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
loading="lazy"
></iframe>
</div>That is what the Responsive layout above produces. It uses the CSS aspect-ratio property, a general web technique rather than a YouTube rule, which every current browser supports and which replaces the old padding-bottom trick. Keep the referrerpolicy line: YouTube Help says embeds need to send a referrer, or playback can fail. Pick Fixed 16:9 only for an old template that cannot handle a wrapper.
Playlists are the documented case. Google's parameter page shows a playlist embed using listType=playlist with the playlist ID in list, and you can also add list= to a normal video embed so the player carries on through the list. Paste a playlist link above and the generator switches to a playlist embed for you.
https://www.youtube.com/embed?listType=playlist&list=PLAYLIST_IDGoogle has no official page on how to embed a YouTube Short. In practice a Short has an ordinary video ID, so the generator takes the ID from a /shorts/ link, builds a standard /embed/VIDEO_ID URL and wraps it in a vertical 9:16 box instead of a widescreen one. Treat it as something that works today, not as a guaranteed feature. Live streams are less certain still. The old embed by channel URL is not in Google's current documentation, so we do not promise it. If you have the watch link of a specific stream, paste it like any other video. To add a way to subscribe under the player, the subscribe link generator builds one.
Adding autoplay=1 asks the player to start, but the browser has the final say. Chrome's autoplay policy always allows muted autoplay. Autoplay with sound is only allowed after the visitor has interacted with your site, when their engagement with media on it is high enough on desktop, or when the site is installed as an app. The IFrame API even has an event for the case where autoplay is blocked.
| Feature | Muted autoplay | Autoplay with sound |
|---|---|---|
| Allowed by Chrome without a click | Yes | No |
| Generator shows a warning | No | Yes |
| Counts as a view on YouTube | No | No |
That is why the generator warns you when Autoplay is on and Muted is off, and why its snippet always includes autoplay in the iframe's allow list. Note the last row: YouTube Help says autoplayed embeds do not increase the video's view count, and Google's parameter page adds that autoplay starts data collection when the page loads. If views are the goal, let visitors press play, then track how the video does with YouTube stats.
Free iframe generator with 18+ parameters, live preview, and modern responsive wrapper.
Generate Embed Code