YouTube Embed Code Generator

Paste a YouTube video link to generate a custom embed code - size, autoplay, start time, and privacy-enhanced mode. Free, instant, no signup.

Fast, free, and no card required. SSL secured.

How it works

  1. Paste the video's URL (or its 11-character video ID) into the box above.
  2. Click Generate to preview the embed and pick your options.
  3. Adjust size, start time, autoplay, controls, or privacy-enhanced mode.
  4. Copy the generated iframe code and paste it into your site.

Why generate a custom embed code

Embed a video in a blog post

Get a clean, correctly-sized iframe to drop into an article or CMS without manually editing YouTube's default code.

Fine-tune the player for your app

Set autoplay, hide controls, or jump to a specific timestamp - options the share button doesn't expose.

Reduce tracking with privacy-enhanced mode

Serve the embed from youtube-nocookie.com so YouTube doesn't set cookies until the visitor actually plays the video.

Need to generate embeds for many videos at once?

This tool is built for quick, one-off use - no account, no cost. To generate embed codes programmatically for many videos, use the public API to pull video IDs and build the same snippet server-side.

View API pricing & credits

YouTube Embed Code Generator FAQs

Is this embed code generator free?

Yes - generating embed codes in any size or configuration is completely free, with no account or sign-up required.

What's privacy-enhanced mode?

It serves the embed from youtube-nocookie.com instead of youtube.com, so YouTube doesn't store tracking cookies on a visitor's browser unless they actually play the video.

Can I make the video start at a specific time?

Yes - enter a start time in seconds and the generated embed will jump straight to that point when played.

Why doesn't autoplay work when I test the code?

Most browsers block autoplay with sound - the video will autoplay muted, or a visitor may need to click once first depending on their browser's policy.

Does this work for private or unlisted videos?

The embed code itself will generate, but a private video won't play for anyone besides its owner - same restriction as viewing it directly on YouTube.