YouTube Embed Code Generator

Create responsive embed code with autoplay, start time and more.

Runs instantly in your browser — results update as you type.

How do I embed a YouTube video responsively?

A responsive YouTube embed wraps the video iframe in a container with a 16:9 aspect ratio, so it scales to any screen width. Embed parameters such as start, autoplay, controls and loop customise how the player behaves.

Options explained

OptionParameterNotes
Start timestart=90Begins playback at 1:30
Autoplayautoplay=1&mute=1Browsers only allow autoplay when muted
Hide controlscontrols=0Cleaner look for background videos
Looploop=1&playlist=IDLoop requires the playlist parameter set to the same ID
Related videosrel=0Shows related videos from the same channel only
Privacy modeyoutube-nocookie.comNo YouTube cookies until the viewer presses play

Why aspect-ratio CSS?

The generated code uses aspect-ratio: 16/9 so the player fills the width of its column and keeps the right height on phones. It also includes loading="lazy", so the heavy YouTube player only loads when scrolled into view — a big win for page speed and Core Web Vitals.

SEO and video

Embedding a relevant video can increase time on page and help your page appear in video results. Add VideoObject structured data and write text around the video — Google needs the page itself to be about the video for it to qualify as a video page.

Get the video's thumbnail with the YouTube Thumbnail Downloader or its statistics with YouTube Video Statistics.

Frequently asked questions

How do I make a YouTube embed responsive?

Wrap the iframe in a container with aspect-ratio: 16/9 and set the iframe to fill it. The generator does this for you.

Why does autoplay not work?

Browsers block autoplay with sound. Autoplay only works when the video is muted, which the generator adds automatically.

What is youtube-nocookie.com?

YouTube's privacy-enhanced mode. It does not set YouTube cookies until the viewer starts the video.

How do I start a video at a specific time?

Enter the start time in seconds. The embed code adds the start parameter, so 90 starts at 1:30.