No login required

YouTube Embed Code Generator

Generate iframe embed code for any YouTube video. Supports custom sizes, no-cookie mode, autoplay and loop options.

Supports any YouTube video URL or raw video ID

Overview

Build a production-ready iframe snippet for any public video

This generator outputs copy-paste <iframe> HTML with size presets, youtube-nocookie.com for stricter privacy defaults, and toggles for controls, autoplay, and loop. Responsive presets help the player fit hero sections, sidebars, and blog widths without hand-editing CSS.

Use it when the Share dialog is too bare — you keep visitors on your site while matching layout and compliance needs. Pair no-cookie mode with muted autoplay when your policy team wants fewer trackers before interaction.

Features

Everything the snippet needs

From GDPR-minded hosts to autoplay-friendly defaults — four levers teams tweak most often before shipping an embed.

Embed Code

Ready
iframe

The tool outputs a standards-friendly iframe snippet you can paste into WordPress, Webflow, Markdown HTML blocks, or any stack that renders raw embed markup.

Size Options

Custom

Pick from common width-by-height presets so the player fits hero sections, article bodies, and sidebars without you hand-tuning pixel math in every deploy.

No-cookie Mode

Privacy

Switch the host to youtube-nocookie.com when your privacy policy or analytics guidelines call for stricter third-party cookie defaults on marketing or help sites.

Player Options

Controls

Autoplay, loop, and related flags are encoded in the query string so you can match product expectations for trailers, onboarding clips, or kiosk-style loops.

How to Use

Ship an embed in three steps

01

Paste the URL

Enter any YouTube video URL or video ID.

02

Customize options

Choose size, privacy mode, and player controls.

03

Copy the embed code

Paste the generated iframe into your HTML or CMS.

Use Cases

Ways People Use This Tool

Blog & CMS

Embed videos in WordPress, Webflow, Ghost, or any HTML-based platform.

GDPR compliance

Use no-cookie embed URLs to avoid tracking before user consent.

Custom sizing

Set exact dimensions to match your layout without manual editing.

Player control

Show or hide controls, enable autoplay, or set loop for background video.

Docs & help

Drop a minimal iframe next to written steps so readers can replay the clip without leaving your knowledge base.

Landing pages

Match hero video blocks to brand grids by copying a preset size instead of guessing responsive breakpoints by hand.

FAQ

Frequently Asked Questions

What is the difference between normal and no-cookie embed?

The no-cookie version uses youtube-nocookie.com and doesn't set cookies until the user interacts with the player, helping with GDPR compliance.

Will the embed work on any website?

Yes, as long as your website allows iframes. Some CMS platforms may sanitize HTML — check your platform's settings.

Can I autoplay embedded videos?

Autoplay is supported but most browsers require the video to be muted for autoplay to work.

Is there a limit to how many videos I can embed?

No. YouTube's embed player has no official limit for standard embeds.