YouTube Embed Code Generator

Generate responsive iframe embed code with start time, autoplay, and privacy mode

Share this tool

Report a problem

Describe the problem without including private input or files.

How useful was this tool?

How useful was this tool?

Input & options

Your inputs are never uploaded or stored.

Results

Enter your values to see the result.

About the Free YouTube Embed Code Generator

Our free YouTube embed code generator turns any YouTube link into clean, copy-ready HTML in seconds. Paste a watch URL, a youtu.be short link, a Shorts link, or a plain 11-character video ID, and the tool instantly builds a valid iframe with the exact player options you choose: start time, autoplay, mute, loop, hidden controls, privacy-enhanced mode, and more.

The standout feature is the responsive YouTube embed mode, enabled by default. Instead of a fixed-width iframe that overflows on phones, the generator wraps the player in a padding-bottom container that keeps a perfect 16:9 aspect ratio at any screen width. That is the same technique used by professional publishers, and it works in every modern browser with zero JavaScript.

Privacy matters too. One checkbox switches the embed code to YouTube's privacy-enhanced youtube-nocookie.com domain, which delays tracking cookies until the visitor actually plays the video, a common requirement for GDPR-conscious sites. Optional lazy loading adds the loading="lazy" attribute so the iframe only loads when scrolled into view, improving page speed and Core Web Vitals.