YouTube Shorts Embed Code Generator
Turn any YouTube Shorts link into a vertical 9:16 embed code. Copy it into your website and the Short plays right on your page.
- Free
- No sign-up
- Works on any website
- Updated September 2026
Settings
<div style="position:relative;width:100%;max-width:360px;aspect-ratio:9 / 16;"> <iframe style="position:absolute;inset:0;width:100%;height:100%;border:0;" src="https://www.youtube.com/embed/abc123DEF45?loop=1&playlist=abc123DEF45&playsinline=1" title="YouTube Shorts player" allow="autoplay; encrypted-media; picture-in-picture; web-share" allowfullscreen></iframe> </div>
Show all your Shorts, not just one
Video Gallery pulls your YouTube Shorts into a vertical carousel that keeps itself up to date — no new code for every Short.
- 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 YouTube Shorts Embed Code generator
- 1Copy the Shorts link
On YouTube, tap Share → Copy link on the Short you want to embed.
- 2Set the size
Choose a max width. The player keeps the vertical 9:16 shape on every screen.
- 3Paste the code
Copy the code and paste it into an HTML or embed block on your site.
How Shorts embeds work
| Setting | What it does | Why it matters |
|---|---|---|
/embed/VIDEO_ID | Shorts use the standard YouTube embed player. | The /shorts/ URL itself can’t be embedded. |
9:16 container | Keeps the video vertical and responsive. | A plain iframe defaults to a wide 16:9 box. |
max width | Limits how wide the vertical player gets. | Stops the Short from filling the whole screen on desktop. |
autoplay + mute | Starts playback automatically without sound. | Browsers block autoplay with sound. |
loop + playlist | Replays the Short like in the Shorts feed. | Loop only works with the playlist parameter. |
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 YouTube Shorts 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
Can you embed YouTube Shorts on a website?
Yes. Shorts play in the standard YouTube embed player — the generator converts the /shorts/ link into an embed code and wraps it in a vertical 9:16 container.
Why does my embedded Short look horizontal?
A plain YouTube iframe uses a 16:9 box. Use the code from this generator, which sets a 9:16 aspect ratio so the Short stays vertical.
How do I embed Shorts in WordPress?
Add a Custom HTML block and paste the code from the generator. It works the same in Elementor’s HTML widget.
Can I embed all Shorts from my channel?
Not with one iframe. A widget like Elfsight Video Gallery can show all your Shorts in a vertical carousel that updates automatically.
Is it free?
Yes, free with no sign-up.
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