youtube embed generator

How to use the youtube embed generator

  1. Paste any YouTube URL — youtube.com/watch, youtu.be/, or youtube.com/shorts/ all work.
  2. Pick a feature set: embed code (iframe with optional autoplay, mute, loop, start/end timestamps), thumbnail URL (hqdefault, mqdefault, sddefault, maxresdefault), or lite embed (privacy-respecting lazy-load version).
  3. For embeds, toggle optional controls: no related videos, hide controls, loop, start at timestamp (seconds).
  4. For thumbnails, choose resolution — maxresdefault is 1280×720 and works on 95% of public videos.
  5. Copy the HTML or plain URL.

When to use it

The standard YouTube iframe loads ~500 KB of JavaScript and tracks the viewer even before they click play. Use lite embed for blog posts, docs, and marketing pages where the video is secondary content — it shows a static thumbnail and only loads the full player when clicked, improving Core Web Vitals dramatically. Use the standard iframe when YouTube-native features (chapters, comments, cards) are important. Alternative: Paul Irish's lite-youtube-embed component is the gold standard; this tool produces the same output as a pre-configured HTML snippet.

Example

<!-- Standard embed with autoplay from 1:30 to 2:45 -->
<iframe src="https://www.youtube.com/embed/VIDEO_ID?autoplay=1&start=90&end=165"
        width="560" height="315" frameborder="0" allow="autoplay" allowfullscreen></iframe>

<!-- Thumbnail URL -->
<img src="https://img.youtube.com/vi/VIDEO_ID/maxresdefault.jpg" alt="Video thumbnail">

<!-- Lite embed - loads player only on click -->
<lite-youtube videoid="VIDEO_ID"></lite-youtube>

Frequently asked questions

Does the embed work on mobile?
Yes — YouTube iframes are fully responsive. Add width="100%" and wrap in an aspect-ratio container for fluid sizing.
Why doesn't maxresdefault.jpg load for some videos?
YouTube only generates maxresdefault for videos uploaded at 720p+ resolution. For older or low-res videos, fall back to sddefault.jpg (640×480) or hqdefault.jpg (480×360).
Is there a way to embed without YouTube tracking?
Yes — use youtube-nocookie.com instead of youtube.com in the iframe src. The tool's privacy mode toggle applies this automatically.
Can I auto-play with sound?
Only if the embed is user-initiated (muted autoplay is always allowed). Chrome and Safari block unmuted autoplay unless the user has interacted with the page.
How do I set a custom start/end time?
Use ?start=90&end=165 query params in seconds. The tool generates these automatically from the time inputs.

Related generators

Last updated: 2026-04-23