YouTube Embed Code Generator

Build clean, responsive YouTube embed code with the options you need: start and end time, autoplay, loop, controls and privacy mode.

Options
    Advertisement

    How to embed a YouTube video

    1. Paste the video’s link. The video ID is detected automatically.
    2. Set a start or end time and tick the options you want.
    3. Check the preview, then copy the code.
    4. Paste the code into your page’s HTML, or a Custom HTML block in WordPress, Wix or Squarespace.
    Advertisement

    YouTube embed parameters

    ParameterWhat it does
    start=90Starts the video at 90 seconds
    end=150Stops the video at 150 seconds
    autoplay=1Plays on load (needs mute=1 in most browsers)
    mute=1Starts muted
    loop=1&playlist=IDRepeats the video
    controls=0Hides the player controls
    rel=0Suggests videos from the same channel at the end
    cc_load_policy=1Shows captions by default

    Tips for faster pages

    • Each embedded player adds weight to your page. The code includes loading="lazy" so the player only loads when visitors scroll to it.
    • Use privacy-enhanced mode on sites that serve visitors in Europe.
    • Only autoplay muted background videos. Autoplay with sound is blocked by browsers and annoys visitors.

    Just want to share a moment of a video? Use the timestamp link generator.

    Last reviewed October 2026.

    Advertisement

    Frequently asked questions

    How do I embed a YouTube video on my website?

    Paste the video link above, choose your options and copy the code. Paste it into your page’s HTML where the video should appear. In WordPress, use a Custom HTML block.

    How do I make a YouTube embed responsive?

    Keep “Responsive” ticked. The code wraps the player in a container that keeps a 16:9 ratio and fills the available width, so it fits phones and wide screens alike.

    Why doesn’t autoplay work?

    Browsers only allow videos to autoplay when they start muted. When you tick Autoplay, the generator mutes the video automatically so it actually plays.

    What is privacy-enhanced mode?

    It loads the player from youtube-nocookie.com, so YouTube doesn’t store information about your visitors until they press play. It is a good default for sites in the EU.

    How do I loop a single video?

    Tick Loop. The code adds the playlist parameter with the same video ID, which YouTube requires for a single video to repeat.

    Can I start and stop at a specific time?

    Yes. Enter a start time and an end time, such as 1:20 and 2:05, and the embedded player plays only that section.

    Advertisement