🎥

Video Embed Generator

A video embed generator turns a page URL into the iframe your site needs. Paste youtube.com/watch?v=dQw4w9WgXcQ and it detects YouTube, pulls the ID and builds https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ?rel=0&modestbranding=1 inside a responsive wrapper with lazy loading. Vimeo, Dailymotion, Twitch, TikTok, Rumble and direct MP4 files are recognised the same way.

✓ detected
▶ YouTube 🎬 Vimeo 🟣 Twitch 📺 Dailymotion ♪ TikTok 📘 Facebook 📡 Rumble 🎥 MP4/WebM

Embed Options

Preview

Embed Code

Embed this tool on your website

× px

                        

💡 Integration Tip

Copy the embed code and paste it into your website HTML. The responsive version adapts to all screen sizes automatically.

0 ratings
✓

About Video Embed Generator

Paste a normal watch URL and the tool works out which service it belongs to and extracts the video identifier, so you never have to find the embed link yourself. Both youtube.com/watch and youtu.be links resolve to the same ID. Vimeo, Dailymotion, Twitch, Facebook, TikTok and Rumble each have their own player address, and a link ending in a video file such as .mp4 is treated as a direct video, producing a native HTML video element with a matching source type instead of an iframe.

YouTube embeds are built on youtube-nocookie.com rather than youtube.com, with rel=0 and modestbranding=1 always appended. The checkboxes add parameters on top: autoplay, mute, loop - which also sets the playlist parameter to the same ID, because a single YouTube video will not loop without it - and turning controls off adds controls=0. Everything else stays out of the URL, so the code is short and readable.

Responsive is on by default and wraps the player in a div with padding-bottom of 56.25 per cent, the standard 16:9 trick that keeps the video the right shape at any width. Turn it off and you get a fixed 640 by 360 iframe instead, with the width and height fields taking over. Lazy loading adds loading="lazy" so the player is only fetched when it scrolls into view, and the border radius slider is written straight into the inline style.

Three output formats sit under the preview. HTML is the full snippet for any template or page builder and ends with a small credit line linking back to this tool - delete that paragraph if you do not want it. WordPress gives a width of 100 per cent with a fixed height, ready for a Custom HTML block. BBCode produces a plain link for forums that do not allow iframes at all. The tool builds markup only: it does not host, convert or download anything, and it cannot make a private or region-blocked video playable.

Use Cases

A blogger adding a product demo pastes the YouTube watch URL, keeps the responsive wrapper, and drops the snippet into a Custom HTML block so the player scales on phones instead of overflowing.
A course author embedding a Vimeo lesson turns off controls and turns on autoplay with mute, because browsers only allow autoplay when the sound is off.
A developer building a landing page keeps lazy loading on so the iframe is not requested until the visitor scrolls to it, and pastes the fixed 640 by 360 version into a grid cell.
A forum moderator who cannot use iframes switches the format to BBCode and posts the plain link version, which every board accepts.
Someone self-hosting an MP4 pastes the file URL and gets a native video element with a source type of video/mp4 rather than an iframe, complete with the same responsive wrapper.

How to use

1

Paste the video page URL into the input box; the platform is detected as you type and its icon appears beside the field.

2

Set the size: leave Responsive on for a 16:9 wrapper that fits any column, or turn it off and type a width and height.

3

Tick the options you need - autoplay, mute, loop, controls, lazy loading - and drag the border radius slider.

4

Check the live preview, which loads the real player with the settings you chose.

5

Choose HTML, WordPress or BBCode in the code panel, press Copy, and paste the block into your page.

6

Click Copy and paste the iframe into your page.

Pro Tips

  • Autoplay only works with mute. Every current browser blocks sound-on autoplay, so tick both boxes or the player will simply sit there paused.
  • The Twitch embed carries a parent parameter set to the hostname of the page where the code was generated - www.freewebtools.com. Change it to your own domain before publishing or the player will refuse to load.
  • Looping a single YouTube video needs the playlist parameter set to the same video ID. The Loop checkbox does that for you, which is why the ID appears twice in the generated URL.
  • Leave responsive on unless you are placing the player in a fixed-width box. The wrapper uses a padding-bottom of 56.25 per cent, so a 16:9 video keeps its shape from a phone to a desktop.
  • The HTML output ends with a small credit paragraph linking back to this tool. It is a normal paragraph in the code you copy - delete it if you prefer, nothing else depends on it.

Troubleshooting

Problem:

Nothing happens after pasting the link.

Solution:

The text was not recognised as a video URL, so no code is produced at all. Paste the full address from the browser bar, including https://, rather than a shortened share text or a search result. A plain phrase with no domain in it is rejected on purpose.

Problem:

The Twitch player shows an error about an invalid parent.

Solution:

The parent parameter in the copied code is set to www.freewebtools.com, the hostname where the code was generated. Twitch requires it to match the site actually showing the player. Replace it with your own domain, and add a second parent parameter for any other hostname such as localhost or a staging site.

Problem:

The video plays but does not autoplay.

Solution:

Browsers only allow autoplay when the video is muted. Tick Mute alongside Autoplay and regenerate the code. Even then some browsers suppress autoplay on metered connections or in battery-saver mode, so treat it as a nice-to-have rather than something your page depends on.

Problem:

The player is squashed or leaves a black band.

Solution:

The responsive wrapper is fixed at 56.25 per cent padding, which is 16:9. A video shot in another aspect ratio - a vertical clip, for instance - will be letterboxed inside it. Turn Responsive off and enter matching width and height values, or change the 56.25% in the copied code to height divided by width times 100.

Problem:

The embed works here but is blank on my site.

Solution:

Three usual causes: a content security policy on your site that does not allow frames from the player domain, a consent or cookie banner that blocks third-party iframes until acceptance, or a platform restriction on the video itself. Check the browser console on your own page - a blocked frame is always reported there.

Frequently Asked Questions

It is the snippet of HTML that puts someone else's player inside your page - almost always an iframe pointing at the platform's player address, with the video ID in the URL. You cannot use the normal watch link for that. This tool converts one into the other: paste the watch URL and it returns the iframe, wrapped and configured.

Paste the watch URL - youtube.com/watch?v=... or a youtu.be short link - and copy the HTML output. The generated source is https://www.youtube-nocookie.com/embed/<id>?rel=0&modestbranding=1 inside a responsive wrapper. Paste that block into your template, a Custom HTML block or a page-builder HTML widget, not into a plain text editor that escapes tags.

YouTube, Vimeo, Dailymotion, Twitch, Facebook, TikTok and Rumble, plus direct video files. A link ending in a media file such as .mp4 becomes a native HTML video element with a matching source type instead of an iframe. Anything it cannot classify is left as a generic URL, and text that is not a link at all is rejected without producing any code.

It is YouTube's privacy-enhanced player domain. The player behaves the same, but YouTube states it does not store information about visitors on your page unless they play the video. This generator always uses it for YouTube embeds, which is one fewer thing to change by hand if you are trying to keep third-party cookies off the page before consent.

Leave the Responsive switch on. The code wraps the iframe in a div with position:relative and padding-bottom:56.25%, and stretches the iframe to fill it. That percentage is 9 divided by 16, so the box keeps a 16:9 shape at any width. Switching it off gives a fixed iframe using the width and height fields instead, 640 by 360 by default.

Because browsers block autoplay with sound. Tick Mute as well as Autoplay and the player starts silently, which is allowed. The generated URL then carries autoplay=1 and mute=1 for YouTube, or autoplay=1 and muted=1 for Vimeo. Some browsers additionally block autoplay in low-power modes, so never rely on it for anything essential.

Twitch requires a parent parameter naming the domain that hosts the player, and this tool fills it with the hostname of the page where you generated the code - www.freewebtools.com. Edit that value to your own domain in the copied snippet. Add several parent parameters if the player runs on more than one hostname, such as a staging site.

It defers the request. With loading="lazy" the browser does not fetch the player until it is near the viewport, so a video far down a long page costs nothing on first load. The attribute is on by default here. Turn it off only if the video is the first thing visitors see, where the delay would be visible instead of helpful.

The generator will happily build the code, but the platform decides whether the player runs. Private videos will not play for anyone but the owner, unlisted ones usually will, and geographic or age restrictions still apply inside the iframe. If a video does not play in the preview panel here, it will not play on your site either.

The player is the same; the packaging differs. HTML is the full snippet with the responsive wrapper and a small credit paragraph. WordPress is a single iframe at 100 per cent width with a fixed height, sized for a Custom HTML block. BBCode is not an embed at all - forums that block iframes get a plain link to the player instead.

Popular Tools

No more tools to show
Explore All Tools
FreeWebTools AI
Powered by free AI models · Full chat →