YouTube Embed Code Generator

Create a clean, responsive embed code for any YouTube video. Set autoplay, mute, loop, start and end times, controls and privacy mode without coding.

YouTube Embed Code Generator

Customize and generate responsive, mobile-ready HTML iframe embed codes with privacy mode and playback controls.

Live Embed Preview & Code

Live Interactive Player Preview

HTML Iframe Snippet

<div style="position: relative; width: 100%; height: 0; padding-bottom: 56.25%; overflow: hidden; border-radius: 8px;">
  <iframe
    src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ"
    title="YouTube video player"
    style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;"
    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
    referrerpolicy="strict-origin-when-cross-origin"
    allowfullscreen>
  </iframe>
</div>
100% Free & No Sign-up Required
Works in Your Browser
Optimized for YouTube Creators

How to Use the YouTube Embed Code Generator

Follow these simple steps to get started in seconds

  1. 1

    Copy the YouTube Video URL

    Copy the link of the YouTube video or Short you want to embed on your website.

  2. 2

    Paste It into YT Crew

    Paste the URL or video ID into the box above. YT Crew reads the video ID and shows a live preview.

  3. 3

    Choose Your Embed Options

    Turn on the responsive wrapper or set a fixed width and height, then choose autoplay, mute, loop, player controls, privacy-enhanced mode and optional start and end times.

  4. 4

    Copy the Code to Your Site

    Click 'Copy Embed Code' and paste it into WordPress, Webflow, Shopify, Squarespace or your own HTML.

About YouTube Embed Code Generator

Why YouTube's Default Embed Code Can Break Your Layout

Embedding videos in blog posts, landing pages and documentation is a great way to make a page more useful and keep readers engaged.

But YouTube's default embed code has a fixed size (width="560" height="315"). On phones and small screens, a fixed-size iframe can overflow the page and break your layout.

The YT Crew YouTube Embed Code Generator fixes this with a responsive wrapper that scales the video to any screen size. It works on WordPress, Next.js, Webflow, Shopify, Ghost and any site where you can add HTML.

YouTube Player Options Explained

YouTube's embedded player supports several settings, and YT Crew lets you set them without editing code:

  • Responsive wrapper: Wraps the iframe in a container that keeps the video's shape while it scales to the page width.
  • Start and end times (start=X&end=Y): Show just one part of a long video, like a single tutorial step or a quote.
  • Autoplay and mute (autoplay=1&mute=1): Useful for landing pages where a video should play silently in the background. Browsers generally only allow autoplay when the video is muted.
  • Hide controls (controls=0): Hides the player controls for a cleaner look.
  • Loop (loop=1&playlist=VIDEO_ID): Plays the video again when it ends.
  • Privacy-enhanced mode (youtube-nocookie.com): YouTube doesn't store information about visitors unless they play the video. It is turned on by default in YT Crew.

How Embedded Videos Can Help Your Website

Adding a relevant YouTube video to an article can help both your site and your channel:

  1. More engaged readers: A good video gives readers another way to understand your topic and can keep them on the page longer.
  2. Video search results: Pages where a video is the main content can be eligible to appear in Google's video results, especially when the video is clearly related to the page.
  3. More views for your channel: When readers play your embedded video, those views count on YouTube too (autoplaying embeds don't count).
Frequently Asked Questions

Questions About YouTube Embed Code Generator

How do I make a YouTube embed responsive on mobile?

YouTube's default embed code uses a fixed size (width 560, height 315), which can overflow small screens. With the responsive option, YT Crew wraps the iframe in a container that keeps the video's shape and scales it to the width of the page.

Can an embedded YouTube video autoplay with sound?

Usually not. Most browsers block videos from autoplaying with sound. Autoplay works reliably only when the video is muted, so turn on Mute together with Autoplay.

How do I embed a YouTube video that starts at a specific time?

Enter the start time in seconds (for example 135 for 2:15). YT Crew adds start=135 to the embed URL. You can also set an end time the same way.

Do views from embedded videos count on YouTube?

Yes. Views from YouTube's embedded player on other websites count toward the video's views when a viewer starts the video. YouTube doesn't count views from embeds that autoplay, so autoplay embeds won't add to your view count.

What is privacy-enhanced mode (youtube-nocookie.com)?

It's a YouTube embed option that uses the youtube-nocookie.com domain. YouTube says it doesn't store information about your visitors unless they play the video. It can help with privacy requirements, but it isn't a full privacy compliance solution on its own.

By Waris Jamil · Last updated 26 October 2026
YT Crew is an independent site, not affiliated with YouTube or Google. Disclaimer

Found this useful?

Share it with a creator friend. It's free for them too.

Related YouTube Creator Tools

More free tools to help you produce and optimize YouTube content

Related YouTube Growth Guides

Playbooks that put this tool to work

All guides