Developer Utilities · Free tool
YouTube Embed Generator
Create customized YouTube embed codes instantly online. Set autoplay, loop, start time, and muted start with a live preview — completely free with no registration needed.
<iframe width="100%" height="400" src="https://www.youtube.com/embed/dQw4w9WgXcQ?mute=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>Live preview
Browsers block autoplay on videos with sound — that’s why "autoplay’ only works when "muted" is on. Use the modern privacy-friendly youtube-nocookie.com URL by replacing youtube.com with youtube-nocookie.com manually after copy if you need GDPR-light embedding.
Advertisement
What it does
Generate a fully-customized YouTube embed iframe. Paste any YouTube URL (full, short, embed, or just the 11- character ID) and configure all the playback options before copying: autoplay (must pair with muted in modern browsers — autoplay-with-sound is blocked everywhere), muted-start, loop (replay continuously), controls visibility, start time (jump to a specific second like 1:35 in the video), end time, and dimensions (width × height in px). Live preview shows exactly what visitors will see.
Use cases: blog posts and tutorials embedding a video example; landing-page hero videos (autoplay-muted- loop is the classic pattern — animation on first paint without surprise audio); course / documentation pages where the video is the canonical reference; portfolio / press kits showcasing work; community sites embedding talks, podcasts, or interview clips.
The generated iframe uses YouTube’s standard <iframe src="https://www.youtube.com/embed/..."> format. For privacy-respecting embeds (no cookies until the user clicks play), use the youtube-nocookie.com domain instead — same iframe, less tracking. The tool offers both options.
Embed this tool on your siteShow snippetHide
Paste this snippet into any page. Loads on-demand (lazy), no tracking scripts, and sized to most dashboards. Replace the height to fit your layout.
<iframe src="https://freetoolarena.com/embed/youtube-embed-generator" width="100%" height="720" frameborder="0" loading="lazy" title="YouTube Embed Generator" style="border:1px solid #e2e8f0;border-radius:12px;max-width:720px;"></iframe>How to use it
- Paste any YouTube URL or video ID. The tool extracts the 11-character ID from any common URL format.
- Set dimensions. 560×315 is YouTube's default; 720×405 for full-width embeds; 1280×720 for HD-quality presentation.
- Toggle autoplay (auto-plays on page load — modern browsers require muted=1 for this to work), muted, loop, controls, fullscreen.
- Optionally set a start time (seconds or H:MM:SS format) to jump to a specific moment, and an end time to cut off playback.
- Toggle 'No-cookie mode' if you want privacy-friendlier embedding — uses youtube-nocookie.com domain, blocks cookies until user interacts.
- Copy the iframe and paste into your HTML. Wrap in a responsive container (CSS aspect-ratio: 16/9) for mobile-friendly resizing.
When to use this tool
- Embedding a YouTube video in a blog post, tutorial page, or landing page.
- Building a hero video that autoplays muted on page load.
- Linking to a specific timestamp in a long video — embed with start=120 jumps to 2:00.
- Creating a playlist of embedded videos in a course or learning module.
When not to use it
- When the video is private or restricted to specific regions — embeds will fail in those contexts.
- AMP pages — YouTube's standard iframe isn't AMP-compatible. Use amp-youtube instead.
- Performance-critical pages — every embed loads YouTube's full player + analytics. For lightweight previews, use a thumbnail image with a click-to-load mechanism (faster initial render, lower bandwidth).
- When you specifically don't want YouTube tracking your visitors — even no-cookie mode loads the player itself; for full privacy, link to the video instead of embedding.
Common use cases
- Educational use — demonstrating the underlying concept
- Onboarding a colleague who needs the same calculation/conversion
- Verifying a number or output before passing it on
- Quick generation during a typical workday
Frequently asked questions
- Why does autoplay require muted?
- Modern browsers (Chrome since 2018, Firefox 2018, Safari 2017) block autoplay of videos with sound to prevent annoying surprise audio. Setting `muted=1` allows autoplay; users can unmute manually if they want sound. This is browser policy, not a YouTube limitation. Mobile browsers are even stricter — they may also require `playsinline=1`.
- What's the difference between youtube.com/embed and youtube-nocookie.com/embed?
- youtube-nocookie.com is YouTube's privacy-friendlier embed domain. It doesn't set tracking cookies until the user actually starts playback. Same player, same features. Use this for sites where you want minimal third-party tracking until interaction. Some users still trigger YouTube's tracking after clicking play, so it's not perfect — just better than the default.
- How do I make the embed responsive?
- Wrap in a CSS container with aspect-ratio: 16/9 and width: 100%. The iframe inside fills the container. Modern CSS aspect-ratio is supported in all modern browsers; for older support, use the padding-bottom: 56.25% trick (16:9 = 56.25%). Each gives you a video that scales fluidly with screen width while maintaining 16:9.
- Can I disable YouTube's recommended-videos overlay?
- Pre-2018: yes via `rel=0`. Post-2018: rel=0 only restricts recommendations to the same channel; you can't disable them entirely. YouTube made this change because the related-videos surface drives engagement on their platform. The tool's option labels this clearly.
- What's the start time format?
- Seconds (start=120 = jump to 2:00) or H:MM:SS in URLs (e.g. youtu.be/...?t=2m30s = 2:30). The tool accepts both and outputs the iframe-compatible seconds format.
- Will the embed work on Substack / Notion / Medium / WordPress?
- Substack: paste the URL, Substack auto-embeds. Notion: same. Medium: yes via the embed block. WordPress: paste into a Custom HTML block, or use the Embed Pro plugin. Square-bracket shortcodes [embed]URL[/embed] also work in WordPress.
Advertisement
Learn more
Guides about this topic
- Using Our Tools · GuideHow to generate QR codesMake QR codes for URLs, WiFi, vCard, or text. Learn error correction and sizing, then generate your QR code online free with no sign-up in seconds.
- Using Our Tools · GuideHow to create a strong passwordGenerate a strong password instantly online for free. Build high-entropy passphrases following NIST 2026 rules with no download needed.
- Developers & Technical · GuideHow to encode and decode Base64Understand the 3-to-4 mechanic and 33% overhead for standard, URL-safe, and MIME Base64. Free online reference to avoid common mistakes, no download needed.
- Design & Media · GuideHow to choose a color paletteBuild accessible color palettes using HSL theory, monochromatic to triadic schemes, WCAG contrast checks, and dark mode tips. Free, no-download guide.
- Developers & Technical · GuideHow to use JWT tokens securelyImplement secure JWT authentication by choosing RS256, setting expiration, using httpOnly cookies, and preventing 'alg: none' attacks in your browser for free.
- Design & Media · GuideHow to design a faviconCreate favicons that render perfectly from 16×16 to 512×512 with dark mode support. Learn the right HTML tags and web manifest setup free online.
Explore more developer utilities tools
- Port Number LookupSearch over 140 well-known TCP and UDP ports by number or service name. Free online reference tool with no sign-up, covering web, mail, DNS, and more.
- Test Credit Card NumbersReference table of canonical test card numbers from Stripe, Adyen, and Braintree sandbox docs. Plus Luhn validator + network detector.
- IPv6 Expander & ShortenerFormat IPv6 addresses to canonical form, handling zone IDs and prefixes, instantly online—free tool with no registration required.
- Htpasswd GeneratorCreate .htpasswd lines for Apache or nginx basic auth with browser-only SHA hashing instantly. Includes config snippets and a free online tool with no registration.
- Chmod CalculatorCalculate Unix file permissions: octal (755, 644) ↔ symbolic (rwxr-xr-x) ↔ rwx checkboxes. Covers setuid, setgid, sticky bit. With presets.
- Excel Formula ExplainerPaste any formula and get a plain-English breakdown of 60+ functions online free—no sign-up required, in your browser.