YTDetective

Tools / Embed Code Generator

YouTube Embed Code Generator

Build a YouTube embed code with a start and end time, autoplay, loop, hidden controls and a privacy-enhanced option, and preview it before you copy.

Options

Enter a video URL or ID to generate your embed code.

Report a bug or suggest an improvement

How this works

The tool builds a standard YouTube iframe from the options you pick. It runs in your browser and uses no YouTube quota.

Browsers block autoplay with sound, so autoplay only works when the video is also muted. The tool warns you when you pick autoplay without mute.

YouTube needs a playlist parameter to loop a single video. The tool adds it for you.

The privacy-enhanced option uses youtube-nocookie.com, which YouTube says does not store viewer information until they play the video. The preview always uses this address, so looking at it does not set YouTube cookies.

Some videos do not allow embedding. If the preview shows an error, the owner has turned embedding off and no code will fix that.

Related guides