Free YouTube Embed Code Generator – Create Responsive iFrame Online

Works with youtube.com/watch, youtu.be, /shorts/, and /live/ links.
Sizing
Embed code


    
Preview
Generate a code block above to preview it here.

About Lantern

Lantern turns a YouTube link into a ready-to-paste embed. It defaults to a responsive layout that holds its 16:9 shape at any screen width, so a video embedded on a phone doesn't get cropped or overflow the page.

Features

  • Responsive by default, or pick a fixed pixel size
  • Works with watch, youtu.be, Shorts, and live links
  • Optional start time, autoplay, mute, and loop
  • Privacy-enhanced mode using youtube-nocookie.com
  • Live preview before you copy anything
  • Nothing is uploaded — the link is only used to build the code

How to use it

  1. Paste the video's link.
  2. Leave sizing on "Responsive" for a mobile-friendly embed, or switch to a fixed width and height.
  3. Set any optional behavior — start time, autoplay, loop, controls.
  4. Tap "Generate embed code," check the preview, then copy the code into your page's HTML.

Frequently asked questions

Why does autoplay need to start muted?

Most browsers block autoplaying video with sound. If autoplay is on, turning on "Start muted" as well gives the best chance the video actually starts playing on its own.

What does "Responsive" actually change?

It wraps the video in a container that keeps a 16:9 shape at 100% of its parent's width, instead of a fixed pixel size — so the video scales down cleanly on narrow phone screens rather than getting cut off or forcing horizontal scroll.

What's the difference with privacy-enhanced mode?

It loads the player from youtube-nocookie.com instead of youtube.com, which YouTube designed to avoid setting cookies related to viewing history until the visitor actually plays the video.

Why does looping need a playlist parameter?

YouTube's player only loops a single video if it's also told to treat that same video as its own one-item playlist — Lantern adds that automatically when looping is turned on.

Can I embed a private or unlisted video?

Unlisted videos embed fine with their link. Private videos generally cannot be embedded for anyone outside the accounts they're shared with.

Post a Comment

Previous Next

نموذج الاتصال