YouTube Embed Code Generator
Paste a video link, pick your options, and copy an embed that behaves properly on phones and does not set cookies before anyone presses play.
Embed code
Paste a video link above and the code appears here.
Where the code goes
The generated code is plain HTML. In WordPress, switch the block to Custom HTML and paste it in. In a page builder, look for an HTML or Embed element. On a hand-written site, it goes anywhere in the body.
Use the responsive option unless you have a specific reason not to. A fixed 560 by 315 player overflows on a phone screen, and horizontal scrolling is one of the things page speed tools and Search Console both flag.
Frequently asked questions
What is privacy enhanced mode?+
It swaps youtube.com for youtube-nocookie.com in the embed. YouTube then avoids setting tracking cookies until someone actually plays the video, which keeps a simple site out of a lot of cookie-consent complexity.
Why does autoplay also mute the video?+
Every modern browser blocks autoplay with sound. Adding mute=1 is what makes autoplay work at all, so this tool adds it automatically whenever you switch autoplay on.
Why does looping need the playlist parameter?+
A quirk of the YouTube player: loop=1 only works when the video is also listed as a playlist of itself. The generator handles that for you.
What does responsive mean here?+
Instead of a fixed pixel size, the player sits in a wrapper that keeps a 16:9 shape and fills whatever width it is given. On a phone it shrinks to fit rather than pushing the page sideways.
More free tools
YouTube Tags Extractor
Pull the tags, title, channel and stats from any public video link.
YouTube Title and Description Checker
Count characters and see where YouTube cuts your title and description off.
YouTube Chapters and Timestamp Generator
Turn a list of sections into correctly formatted chapters YouTube will accept.