Generate customizable embed codes for your YouTube videos. Set dimensions, autoplay, controls, start time, and more. Copy-paste ready HTML code.
Choose the right dimensions for your website layout.
Full control over how your embedded video looks and behaves.
Copy any YouTube video URL and paste it into the input field. Works with regular videos, Shorts, and live streams.
Adjust dimensions, enable autoplay, set start time, and configure other playback options to match your needs.
Preview the embed, copy the generated HTML code, and paste it into your website's HTML editor.
A YouTube embed code is an HTML snippet (iframe) that allows you to display a YouTube video on your website. It contains the video URL and player settings, making it easy to share videos outside of YouTube. When visitors view your page, the video player loads directly within your content.
To embed a YouTube video: 1) Paste the video URL into our generator, 2) Customize the settings like size, autoplay, and controls, 3) Copy the generated embed code, 4) Paste the code into your website's HTML where you want the video to appear. Most website builders and CMS platforms have an HTML block or code editor for this purpose.
The recommended aspect ratio is 16:9. Common sizes include 560x315 (small), 640x360 (medium), 853x480 (large), and 1280x720 (HD). For responsive websites, use the responsive embed option which automatically adapts to any screen size while maintaining the correct aspect ratio.
Yes, you can enable autoplay by checking the autoplay option in the generator. However, note that most modern browsers require videos to be muted for autoplay to work automatically. This is a browser policy to improve user experience. When you enable autoplay, we also enable mute by default to ensure it works across all browsers.
Use the Start Time option in our generator to specify when the video should begin playing. Enter the time in seconds (e.g., 90 for 1:30). The embed code will automatically include the 'start' parameter. This is useful for skipping intros or directing viewers to specific parts of longer videos.
Standard YouTube embeds have fixed dimensions and won't automatically resize. However, our generator offers a responsive embed option that wraps the iframe in a CSS container. This allows the video to scale proportionally on any device while maintaining the 16:9 aspect ratio, making it mobile-friendly.
Yes, you can hide the player controls using the "Show Controls" toggle. When disabled, the video player will have a cleaner appearance without the play/pause button, progress bar, and volume controls. Note that viewers can still control the video by clicking on it to play/pause.
YouTube embeds can impact page load time since they load external resources. To minimize this: 1) Don't embed too many videos on one page, 2) Use lazy loading (videos load only when scrolled into view), 3) Consider using a thumbnail placeholder that loads the actual player on click. The iframe includes a loading="lazy" attribute by default.
Unlisted videos can be embedded - anyone with the link can view them. Private videos cannot be embedded; they will show an error message. Only the video owner and people they've explicitly shared it with can view private videos, and they must be signed in to YouTube.
Privacy-enhanced mode uses youtube-nocookie.com instead of youtube.com. This means YouTube won't store information about visitors on your website unless they actually play the video. It's a more privacy-friendly option, especially for websites that need to comply with GDPR or similar privacy regulations.
Discover more tools to optimize and enhance your YouTube videos.