YouTube embed code generator
Paste a YouTube URL and generate a clean iframe embed — with autoplay, loop, start time, privacy-enhanced mode and responsive wrapper options.
Paste a YouTube URL above to generate the embed code.
About the YouTube embed code generator
Handytool's YouTube embed code generator turns any YouTube URL into a ready-to-paste iframe. Toggle autoplay, loop, mute, controls, start time and the privacy-enhanced (youtube-nocookie.com) host, pick fixed width/height or a responsive 16:9 wrapper, then copy the embed code. A live preview plays the video with your settings so you can verify the embed before shipping it to your site.
YouTube embed code generator features
- 01
Every embed option, in one place
Autoplay, mute, loop, controls, related videos, modest branding and start time — all toggleable. The generator keeps your iframe compliant with YouTube's latest parameters so it renders the same in production as in the preview.
- 02
Privacy-enhanced host by default
Uses youtube-nocookie.com so YouTube doesn't drop tracking cookies until a visitor actually plays the video. Great for GDPR-friendly sites that still want YouTube's player.
- 03
Responsive or fixed size
Switch to the responsive wrapper for a 16:9 iframe that fills its container — perfect for blog posts and landing pages. Or keep the classic fixed width/height for documentation and help pages.
YouTube embed code generator FAQ
- How do I embed a YouTube video on my website?
- Paste the YouTube URL, pick the options you want (start time, autoplay, responsive), and copy the generated iframe. Paste it into your HTML, CMS or Markdown file where the video should appear.
- What does privacy-enhanced mode do?
- It swaps youtube.com for youtube-nocookie.com. YouTube delays setting tracking cookies until a visitor clicks play, which helps with cookie-consent and GDPR requirements.
- Why does autoplay force mute?
- Chrome, Safari and Firefox block autoplay for videos with sound. The generator adds mute=1 whenever autoplay is on so the video actually starts instead of showing a paused player.
- Can I start the video at a specific timestamp?
- Yes. Enter the start time as seconds (42), minutes:seconds (1:23) or hours:minutes:seconds (1:02:03). The tool appends the right start parameter to the iframe URL.
- How do I loop a YouTube embed?
- Enable Loop. The generator adds loop=1 and playlist=VIDEO_ID — both parameters are required together because YouTube only loops videos that are part of a playlist.
- Is the embed code generated on your servers?
- No. The URL is parsed and the iframe is assembled entirely in your browser. Handytool has no record of the videos you embed.
Related tools
Social →- Live
YouTube thumbnail downloader
Paste any YouTube URL and download the video thumbnail in HD, SD or standard resolution — no sign-in, no upload, nothing sent to a server.
SocialRuns locallyOpen - Live
YouTube video & channel ID extractor
Extract the video ID, channel ID, handle or playlist ID from any YouTube URL — watch, Shorts, youtu.be, embed or @handle links all supported.
SocialRuns locallyOpen - Live
YouTube thumbnail tester
Preview your thumbnail the way viewers will actually see it — in search results, sidebar up-next, mobile home feed and the browse grid. Light and dark mode, no upload.
SocialRuns locallyOpen
Explore other tools
All tools →- Live
PDF to JPG
Convert each page of a PDF into a sharp JPG, PNG, or WebP image right in your browser — no upload, no quality loss.
PDFRuns locallyOpen - Live
Remove background
Erase the background of a photo using an in-browser AI model — no upload, your images stay on your device.
ImageRuns locallyOpen - Live
Trim Video
Cut the start or end of a video with frame-level precision.
VideoOpen - Live
Trim audio
Cut a section of an audio file.
AudioRuns locallyOpen - Live
Markdown to HTML
Convert Markdown into clean HTML right in your browser.
DocumentRuns locallyOpen