Generate the HTML embed code for a YouTube video with custom width, height, autoplay and other options.
YouTube provides an embed code for every public video, but the default code is not always what you want. This generator lets you customise the dimensions, enable or disable autoplay, loop, related videos and player controls, and outputs a clean iframe tag ready to paste.
The embed uses YouTube's privacy-enhanced mode (youtube-nocookie.com) by default, which does not set tracking cookies until the viewer clicks play.
For responsive design, wrap the iframe in a container with padding-top: 56.25% (16:9 aspect ratio) and set the iframe to position:absolute, width:100%, height:100%.
It uses youtube-nocookie.com instead of youtube.com. No tracking cookies are set until the viewer clicks play.
Wrap the iframe in a div with padding-top:56.25% and position:relative. Set the iframe to position:absolute, width:100%, height:100%.
Partially — the modestbranding parameter used to hide it, but YouTube deprecated it in 2023.
Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.
Vai.la is not responsible for how the tools are used or for decisions made based on their results.