NEWMeet the new Video Gallery — YouTube, TikTok, Instagram Reels, Vimeo and Twitch in one widget.

Find a widget for you

You can use our widgets to accomplish practically any task on your website — increase users' confidence, grow conversion, engage your visitors, provide support, etc.

See All Widgets
Video Gallery

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

VideoLive player preview on the production page
Embed code
<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>

Elfsight Video Gallery

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
Create Widget for Free Embed a YouTube channelNo credit card needed
YouTube
Behind the Scenes: Studio Tour
TikTok
First Descent of the Season: Heli Drop in the Alps
Twitch
Late Night Ranked Grind
Instagram
Morning Flow: 10-Minute Full Body Stretch
YouTube
Restaurant Plating at Home, Step by Step
Vimeo
Where the Pavement Ends: Full Off-Road Test

How to use the YouTube Embed Code generator

  1. 1Paste a link

    Copy any youtube.com, youtu.be, Shorts, live or playlist URL and paste it above.

  2. 2Choose options

    Turn on autoplay, loop, captions, a start time or privacy-enhanced mode. The code updates live.

  3. 3Copy and paste

    Click Copy code and paste it into your website builder’s HTML or embed block.

YouTube embed parameters

ParameterWhat it doesExample
autoplay=1Starts the video automatically. Most browsers only allow this when the video is muted.autoplay=1&mute=1
mute=1Starts playback muted.mute=1
loop=1Replays the video. Needs the playlist parameter set to the same video ID.loop=1&playlist=ID
controls=0Hides the player controls.controls=0
start / endStarts or stops playback at a given second.start=90
cc_load_policy=1Shows captions by default.cc_load_policy=1
rel=0Shows related videos from the same channel only.rel=0
youtube-nocookie.comPrivacy-enhanced mode: views don’t personalize the viewer’s YouTube experience or ads.youtube-nocookie.com/embed/ID

Source: YouTube embedded players and player parameters

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 →

Embed code vs. Elfsight Video Gallery

Embed codeVideo Gallery
Videos per embedOne video (or one playlist)Unlimited videos in one widget
Stays up to dateEdit the code for every new videoNew YouTube videos appear automatically
Mix sourcesOne platform per snippetYouTube, Vimeo, TikTok, Instagram, Twitch and any video link
LayoutsSingle playerPlayer with Gallery, Carousel, Grid, Masonry, Playlist
Responsive designNeeds a CSS wrapperBuilt in
CodingCopy and paste code for each videoNo code — edit visually in the editor
PriceFreeFree 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