YouTube Embed Code Generator

Build clean, custom YouTube embed codes and preview how your thumbnails will look in a typical YouTube-style frame.

Generate a custom embed code

Start times like &t=33s or &t=1m10s will be respected where possible.

YouTube thumbnail mockup preview

Upload an image to see how it looks inside a YouTube-style player frame. This is useful when designing thumbnails before you upload them to YouTube or sharing them as social previews.

For best results, use a 16:9 image (e.g. 1280×720 or 1920×1080).

Preview

Your thumbnail will appear here

Better embeds and better thumbnails

Clean embed code helps your pages load faster and reduces clutter, particularly when you only need a simple player. Being able to toggle autoplay, loop, mute and controls gives you fine-grained control over how viewers experience your content on your own site.

Thumbnail mockups help you judge whether text is readable, whether faces are big enough, and whether your design still works at smaller sizes — which is exactly how most viewers see it in the YouTube feed.

Understanding YouTube embed parameters

YouTube's iframe embed API supports a range of parameters that control player behaviour. This generator sets them for you, but knowing what each one does helps you make better decisions for your site.

Option Parameter What it does When to use it
Privacy-enhanced mode youtube-nocookie.com Prevents YouTube from setting tracking cookies until the viewer clicks play GDPR-conscious sites, privacy policies that restrict third-party cookies
Autoplay autoplay=1 Starts playback when the embed loads (muted by default in most browsers) Background video on landing pages, product demos, kiosk displays
Loop loop=1&playlist=ID Replays the video continuously after it ends Ambient video backgrounds, event screens, waiting room displays
Mute on start mute=1 Starts the video with volume at zero Required for autoplay in Chrome and Safari; useful for inline previews
Hide controls controls=0 Removes the play bar, volume slider, and timeline from the player Clean presentation embeds, digital signage, portfolios

Common embed scenarios and best practices

Blog posts and articles

Use the standard embed with privacy-enhanced mode enabled. This keeps your page GDPR-friendly while giving readers a familiar YouTube player. Avoid autoplay on editorial pages — readers expect to choose when to start a video.

Landing pages and product demos

Autoplay with mute works well for hero sections where the video serves as a visual hook. Pair it with loop if the clip is short (under 30 seconds) so the motion continues while visitors read the page.

Online courses and tutorials

Keep controls visible so learners can pause, scrub, and adjust volume. If the video has chapters, standard embeds will display them automatically in the progress bar.

Portfolios and case studies

Hidden controls create a cleaner visual presentation. Combine with a custom play button overlay in your CSS for a branded experience that still uses YouTube's hosting and CDN for reliable playback.

Thumbnail mockup tips for designers

The mockup preview above places your image inside a YouTube-style player frame so you can evaluate your thumbnail design before uploading it to Studio. Here are practical tips for getting the most out of the preview:

  • Test at 16:9 (1280×720 or 1920×1080) — this is YouTube's expected thumbnail aspect ratio. Non-standard ratios will be letterboxed or cropped.
  • Check text legibility at small sizes — thumbnails appear as small as 168×94 pixels in mobile search results. If your title text is unreadable at that scale, simplify it.
  • Compare against your existing thumbnails — upload your new design and an older one side by side (in separate tabs) to ensure visual consistency across your channel.
  • Look at face and expression visibility — face-led thumbnails outperform on many channels, but only when the expression is clear at thumbnail scale. See the design teardown examples for more.

For more on thumbnail sizing, see the thumbnail size guide. To download existing thumbnails for comparison, use the thumbnail grabber. For a complete overview of YouTube image types, visit the image asset reference center.

Frequently asked questions about YouTube embeds

What is privacy-enhanced mode?

Privacy-enhanced mode uses the youtube-nocookie.com domain instead of youtube.com. This prevents YouTube from storing cookies on your visitor's browser until they actually click play, which helps with GDPR and ePrivacy compliance.

Why does autoplay not work on my site?

Most modern browsers block autoplay with sound. To autoplay reliably, you must also enable the mute option (mute=1). This is a browser policy, not a YouTube limitation. Chrome, Safari, and Firefox all enforce it.

Can I customise the embed dimensions?

Yes. The generated iframe code includes width and height attributes that you can change. For responsive embeds, wrap the iframe in a container with padding-bottom: 56.25% (the 16:9 ratio) and set the iframe to width: 100%; height: 100%; position: absolute.

Does this tool store the videos I generate embeds for?

No. The embed code is generated entirely in your browser. No video URLs, IDs, or generated code are sent to any server or stored anywhere.