YouTube Video Embed Code Generator

Generate fully customized YouTube embed code with live preview. Control autoplay, loop, captions, privacy mode, start time, and responsive sizing — all in one place.

Live Preview Responsive Code 10+ Options 100% Free
Step 1 — Enter YouTube Video URL
Video ID detected:
Please enter a valid YouTube URL.
Step 2 — Size & Dimensions
W px
H px

Aspect ratio: 16:9 — locked 🔒

Step 3 — Embed Options
▶️
Autoplay
Video plays automatically on load
🔇
Mute
Start video muted (required for autoplay)
🎛
Show Controls
Display player controls bar
🔁
Loop
Repeat video continuously
Fullscreen
Allow fullscreen button
💬
Captions
Show closed captions by default
🔒
Privacy Mode
Use youtube-nocookie.com (GDPR friendly)
🎨
Modest Branding
Minimal YouTube logo overlay
⌨️
Keyboard Controls
Allow keyboard shortcuts

e.g. 90 = start at 1:30

Live Preview
Click to interact with the video
Your Embed Code

      

📋 How to Use the YouTube Embed Generator

  1. Paste your YouTube video URL — supports watch, youtu.be, shorts, and playlist links.
  2. Select a size preset or enter a custom width and height. Use the lock button to maintain aspect ratio.
  3. Toggle embed options like autoplay, loop, privacy mode, and captions as needed.
  4. Set an optional start or end time to embed a specific clip.
  5. Click Generate and see a live preview instantly.
  6. Choose between Fixed, Responsive CSS, or aspect-ratio code formats and copy your embed code.

💡 YouTube Embed Tips & Best Practices

🔒 Privacy Mode

Use youtube-nocookie.com to prevent YouTube from setting cookies until the viewer plays the video — great for GDPR compliance.

📱 Responsive Embed

The responsive CSS wrapper makes your video scale perfectly on all screen sizes without JavaScript.

▶️ Autoplay Policy

Browsers block autoplay with sound. Always enable Mute alongside Autoplay for it to actually work.

⏱ Start Time

Link viewers directly to the most important part of your video using the start time parameter (in seconds).

🚫 Hide Related

Set rel=0 to show related videos only from your channel at the end — reduces viewer drop-off to competitors.

🎛 No Controls

Disabling player controls creates a clean, cinematic look — great for background video sections on websites.