YouTube Embed Code Generator
Paste any YouTube link and get a responsive embed code in seconds. Set autoplay, loop, start time, captions and privacy mode, then copy the iframe into any website.
- Free
- No sign-up
- Works on any website
- Updated September 2026
Settings
<div style="position:relative;width:100%;aspect-ratio:16 / 9;"> <iframe style="position:absolute;inset:0;width:100%;height:100%;border:0;" src="https://www.youtube.com/embed/aqz-KE-bpKQ?rel=0&playsinline=1" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> </div>
Want the whole channel, not one video?
Video Gallery turns your YouTube channel or playlist into a gallery that updates itself — every new upload appears on your site automatically.
- Auto-updates when you publish new videos
- Carousel, grid, masonry or player with playlist
- YouTube, Vimeo, TikTok, Instagram, Twitch and any video link
- No coding — works on any website
How to use the YouTube Embed Code generator
- 1Paste a link
Copy any youtube.com, youtu.be, Shorts, live or playlist URL and paste it above.
- 2Choose options
Turn on autoplay, loop, captions, a start time or privacy-enhanced mode. The code updates live.
- 3Copy and paste
Click Copy code and paste it into your website builder’s HTML or embed block.
YouTube embed parameters
| Parameter | What it does | Example |
|---|---|---|
autoplay=1 | Starts the video automatically. Most browsers only allow this when the video is muted. | autoplay=1&mute=1 |
mute=1 | Starts playback muted. | mute=1 |
loop=1 | Replays the video. Needs the playlist parameter set to the same video ID. | loop=1&playlist=ID |
controls=0 | Hides the player controls. | controls=0 |
start / end | Starts or stops playback at a given second. | start=90 |
cc_load_policy=1 | Shows captions by default. | cc_load_policy=1 |
rel=0 | Shows related videos from the same channel only. | rel=0 |
youtube-nocookie.com | Privacy-enhanced mode: views don’t personalize the viewer’s YouTube experience or ads. | youtube-nocookie.com/embed/ID |
How to add the code to your website
In the block editor, add a Custom HTML block where the video should appear and paste the code. In the classic editor, switch to the Text tab first.
See Video Gallery for WordPress →Go to Online Store → Themes → Customize, add a Custom Liquid section to the page and paste the code.
See Video Gallery for Shopify →Click Add → Embed Code → Embed HTML, choose Code and paste the snippet, then resize the element.
See Video Gallery for Wix →Edit the page, add a Code block and paste the snippet. Blocks with scripts may require a Business plan or higher.
See Video Gallery for Squarespace →Drag a Code Embed element from the Add panel onto the page and paste the code. Publish to see it live.
See Video Gallery for Webflow →Paste the code into your page’s HTML inside <body>, where the video should appear.
Embed code vs. Elfsight Video Gallery
| Embed code | Video Gallery | |
|---|---|---|
| Videos per embed | One video (or one playlist) | Unlimited videos in one widget |
| Stays up to date | Edit the code for every new video | New YouTube videos appear automatically |
| Mix sources | One platform per snippet | YouTube, Vimeo, TikTok, Instagram, Twitch and any video link |
| Layouts | Single player | Player with Gallery, Carousel, Grid, Masonry, Playlist |
| Responsive design | Needs a CSS wrapper | Built in |
| Coding | Copy and paste code for each video | No code — edit visually in the editor |
| Price | Free | Free plan, no credit card needed |
Frequently asked questions
What is a YouTube embedder?
A YouTube embedder is a tool that turns a YouTube link into embed code for your website. This YouTube video embedder builds a responsive iframe with options like autoplay, loop, start time and privacy-enhanced mode — free, no sign-up.
How do I get the embed code for a YouTube video?
Paste the video link into the generator above and copy the code. You can also open the video on YouTube, click Share → Embed, but that won’t give you a responsive version or extra options.
How do I make a YouTube embed responsive?
Keep the Responsive option on. The generator wraps the iframe in a container with a 16:9 aspect ratio, so the video scales to the width of your page on any screen.
Why doesn’t autoplay work?
Browsers block autoplay with sound — see the Chrome autoplay policy. The generator adds mute=1 when you turn on autoplay, which is what lets the video start on its own.
How do I loop a YouTube video?
Turn on Loop. YouTube only loops embedded videos when the playlist parameter contains the same video ID, and the generator adds it for you.
Can I embed a whole YouTube channel?
YouTube’s player can load a channel’s uploads as a playlist, but it’s still one player with a list — no layout, design or source mixing. To show a full channel as a gallery that updates automatically, use a YouTube channel widget such as Elfsight Video Gallery.
Is this YouTube embed code generator free?
Yes. It’s free, needs no sign-up and has no limits.
Official documentation
More free tools
Related guides
From one video to a gallery people watch
Create a free video gallery in minutes and add it to any website.
Create Widget for Free