Video Embed Code Generator
Get an embed code for a video hosted anywhere: an MP4 file, Google Drive, Dropbox, Loom or Wistia. Paste the link and copy clean, responsive HTML.
- Free
- No sign-up
- Works on any website
- Updated September 2026
Settings
<div style="position:relative;width:100%;aspect-ratio:16 / 9;">
<video style="position:absolute;inset:0;width:100%;height:100%;border:0;" controls playsinline preload="metadata">
<source src="https://example.com/videos/intro.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>Have more than one video?
Video Gallery shows videos from anywhere — your own hosting, Drive, Dropbox, YouTube or Vimeo — in one gallery, grid or carousel.
- Auto-updates when you publish new videos
- Carousel, grid, masonry or player with playlist
- YouTube, Vimeo, TikTok, Instagram, Twitch and any video link
- No coding — works on any website
How to use the Video Embed Code generator
- 1Paste a link
Use a direct .mp4 or .webm link, or a Google Drive, Dropbox, Loom or Wistia share link.
- 2Pick options
Choose controls, autoplay, loop and an optional poster image.
- 3Copy the code
Paste the HTML into an embed block. The generator uses the right format for each source.
Supported sources and what the code uses
| Source | Embed format | Tip |
|---|---|---|
MP4 / WebM file | HTML5 <video> tag | MP4 (H.264 + AAC) plays in every modern browser. |
Google Drive | /file/d/ID/preview iframe | Set sharing to “Anyone with the link”. |
Dropbox | <video> with raw=1 | raw=1 streams the file instead of downloading it. |
Loom | loom.com/embed/ID iframe | Use the share link from Loom. |
Wistia | fast.wistia.net/embed/iframe/ID | Paste the media page URL. |
Source: MDN: The Video Embed element
How to add the code to your website
In the block editor, add a Custom HTML block where the video should appear and paste the code. In the classic editor, switch to the Text tab first.
See Video Gallery for WordPress →Go to Online Store → Themes → Customize, add a Custom Liquid section to the page and paste the code.
See Video Gallery for Shopify →Click Add → Embed Code → Embed HTML, choose Code and paste the snippet, then resize the element.
See Video Gallery for Wix →Edit the page, add a Code block and paste the snippet. Blocks with scripts may require a Business plan or higher.
See Video Gallery for Squarespace →Drag a Code Embed element from the Add panel onto the page and paste the code. Publish to see it live.
See Video Gallery for Webflow →Paste the code into your page’s HTML inside <body>, where the video should appear.
Embed code vs. Elfsight Video Gallery
| Embed code | Video Gallery | |
|---|---|---|
| Videos per embed | One video (or one playlist) | Unlimited videos in one widget |
| Stays up to date | Edit the code for every new video | New videos appear automatically |
| Mix sources | One platform per snippet | YouTube, Vimeo, TikTok, Instagram, Twitch and any video link |
| Layouts | Single player | Player with Gallery, Carousel, Grid, Masonry, Playlist |
| Responsive design | Needs a CSS wrapper | Built in |
| Coding | Copy and paste code for each video | No code — edit visually in the editor |
| Price | Free | Free plan, no credit card needed |
Frequently asked questions
How do I embed an MP4 video on a website?
Paste the direct link to the .mp4 file and copy the generated HTML5 video code. Add a poster image so visitors see a thumbnail before playback.
How do I embed a Google Drive video?
Share the file with “Anyone with the link”, paste the link above and copy the iframe. It uses Drive’s /preview player.
Can I embed a Dropbox video?
Yes. The generator changes the link to raw=1 so the video streams in your page instead of downloading.
Why won’t my video autoplay?
Browsers only allow autoplay for muted videos (see the Chrome autoplay policy), so autoplay in this generator always starts muted.
Should I host videos myself?
Self-hosting works for short clips, but large files use a lot of bandwidth. For longer videos, a platform like YouTube or Vimeo is usually faster for viewers.
Official documentation
More free tools
Related guides
From one video to a gallery people watch
Create a free video gallery in minutes and add it to any website.
Create Widget for Free