About the YouTube Embed Code Generator
Embed a YouTube video on a website or blog with clean, responsive code, and set where it starts and how it behaves without editing URL parameters by hand.
YouTube’s Share → Embed button gives you a fixed 560×315 iframe that does not resize on phones, and its options are limited. This generator builds cleaner embed code from any YouTube link, with the settings website owners actually need.
The responsive option wraps the video in a container with a 16:9 aspect ratio, so it fills the width of your content area on any screen without black bars or overflowing on mobile. You can choose a start time (type 1:30 or 90, or paste a link that already contains t=90s), hide the player controls, loop the video, turn on captions by default and use YouTube’s privacy-enhanced youtube-nocookie.com domain. Lazy loading tells the browser not to load the player until the reader scrolls near it, which speeds up pages with several videos.
A live preview appears when you click “Show preview”, so the page itself stays fast and nothing is loaded from YouTube until you ask.
How to use the YouTube Embed Code Generator
- 1Paste a YouTube link or ID.
- 2Choose responsive or fixed size and the options you want.
- 3Copy the embed code into your page.
Key features
- Responsive 16:9 or fixed width and height.
- Start time from minutes:seconds or the link itself.
- Autoplay (muted), loop, hide controls, captions.
- Privacy-enhanced mode and lazy loading.
- Copy button and optional preview.
Practical uses
- Adding a video to a blog post, WordPress page or custom HTML site.
- Starting a tutorial at the exact step you are discussing.
- Creating a silent looping background video.
- Embedding in a GDPR-sensitive site with fewer cookies.
Tips and common mistakes
- Use responsive mode unless your layout has a fixed-width column.
- Autoplay is usually annoying for readers; use it only for silent loops.
- The code includes a title attribute for screen readers; change it to describe your video if you like.
Limitations
- Some videos have embedding disabled by their owner and will not play on other sites.
- Playlists and channel embeds are not generated.
Privacy
The code is built in your browser. YouTube is contacted only if you load the preview.
Frequently asked questions
Why does autoplay also mute the video?
Browsers block autoplay with sound, so YouTube only autoplays muted videos.
What is privacy-enhanced mode?
It uses youtube-nocookie.com, which does not set YouTube cookies until the visitor plays the video.
How does looping work?
YouTube loops a single video only when it is also given as a one-item playlist, which the generator adds for you.
Is the responsive code supported everywhere?
It uses CSS aspect-ratio, which works in all current browsers.