Paste a link. Get the embed.

uEmbed.js turns plain media links in your content into responsive embeds. YouTube, Vimeo, Instagram, X, TikTok, Spotify and eight more. No HTML for your editors, one script tag for you.

<script src="https://uembed.nuevvo.com/releases/2.0/uembed.js"></script>

What your editor types

{https://youtu.be/v2AC41dglnM}

What your readers see

Works with links from

  • YouTube
  • Vimeo
  • Instagram
  • X
  • TikTok
  • Facebook
  • Spotify
  • SoundCloud
  • Dailymotion
  • Flickr
  • Giphy
  • Tenor
  • imgur
  • Glomex

Editors paste links. Pages get embeds.

Built at Nuevvo for busy content teams, and running on live sites for years.

An editor spots a video, a post or a track they want in an article. Normally that means finding the share menu, copying an embed code, switching the editor to HTML view, pasting it in, and hoping the editor doesn't mangle it on save.

Even when it works, the result is a fixed-size embed that breaks on phones, and fixing that falls to whoever looks after the site's code.

With uEmbed.js, the editor copies the link and puts it in curly braces, or simply on a line of its own. When the page loads, uEmbed.js swaps the link for the right embed and makes it responsive. Two birds, one stone.

There's a quieter benefit too. Your database only stores links, not embed code. When a provider changes how its embeds work (Dailymotion did, in September 2026), you update one script and every old article is fixed.

The usual way

  1. Find the share menu, then “Embed”
  2. Copy a block of HTML
  3. Switch the editor to source view
  4. Paste, save, check it didn't break
  5. Ask a developer to make it responsive

With uEmbed.js

  1. {https://vimeo.com/76979871}

That's it. Phones, tablets and desktops included.

One script tag. That's the whole integration.

uEmbed.js loads its own stylesheet, works on rendered HTML from any CMS (WordPress, Joomla, Drupal, a static site, your own), and needs no build step or dependencies. About 11 KB gzipped, plus 1.4 KB of CSS. Free and open source under the MIT License.

Responsive by default

Video keeps its shape, vertical video stays vertical, audio players keep their height. Nothing spills out of a narrow column.

Three ways to write a link

In curly braces, alone on its own line, or after the editor has turned it into a link. Square brackets or parentheses if braces clash with your templates.

10× faster

20 YouTube links in a long article: about 25 ms in 2.0, 261 ms in 1.11. One pass, one write, every third-party script loaded once.

Leaves your page alone

By default only the link itself is replaced, so sliders, lightboxes and other scripts keep working. Code samples and <pre> blocks are skipped.

Content that arrives later

Comments, infinite scroll, AJAX tabs: add watch=1 and new links convert as they appear, or call uEmbed.init() yourself.

Careful with what it touches

Titles from providers are escaped, there's no eval, and if your site uses a Content Security Policy, the script's nonce is passed on to every script uEmbed.js adds. Unsupported links and links inside a sentence are never touched.

See it on a real-looking site

Every embed on our demo site started as a plain link in its HTML. No embed code anywhere.

The top of the Mostly Feedback demo site: a big masthead and a lead story with a YouTube video

Meet Mostly Feedback, our demo rock magazine

36 embeds from 13 providers: videos, Shorts and TikToks in a row, a Spotify and SoundCloud playlist, posts, GIFs and photos. All from one script tag with default settings.

Visit the demo site
Demo section with a photo, an Instagram post, an X post and Spotify players
Posts and players, side by sideInstagram, X and Spotify in a magazine grid.
Demo playlist with Spotify tracks, a Spotify playlist and album, and SoundCloud players
A playlist built from linksSpotify tracks, albums and playlists, plus a SoundCloud track and set.
Demo section with a YouTube clip, Tenor and Giphy GIFs and an imgur post
GIFs and clipsYouTube, Tenor, Giphy and imgur in a masonry layout.

Install in about a minute

No package manager, no build. Link the hosted file or keep your own copy.

  1. Add the script before </body>

    Use the hosted copy, pinned to version 2.0:

    <script src="https://uembed.nuevvo.com/releases/2.0/uembed.js"></script>

    Or host it yourself: put uembed.js and uembed.css in the same folder. The script finds its stylesheet next to it.

  2. Point it at your content (optional)

    By default uEmbed.js scans the whole <body>. To limit it to your article text, pass the CSS class of the element that wraps it:

    <script src="…/uembed.js?context=article-body"></script>

    All the options work this way, as parameters on the script's URL. See Options.

  3. Tell your editors

    Copy a link, paste it in curly braces or on its own line, publish. That's the whole training session.

    <!-- in the article, as saved by the editor -->
    <p>Here's the video everyone is talking about:</p>
    <p>{https://www.youtube.com/watch?v=v2AC41dglnM}</p>

Reference

How to write links, every option, every provider, and the hooks for developers.

Live example

This page runs uEmbed.js too, limited with context=uembed-live to the box on the right. Same links as on the left, converted as the page loaded.

<div class="uembed-live">
  <p>{https://vimeo.com/76979871}</p>
  <p>https://open.spotify.com/track/57bgtoPSgt236HzfBOd8kj</p>
</div>

<script src="…/uembed.js?context=uembed-live"></script>

Result, live

{https://vimeo.com/76979871}

https://open.spotify.com/track/57bgtoPSgt236HzfBOd8kj

Options

Add options as parameters on the script's URL, for example uembed.js?context=article-body&b=square. Booleans take 0 (off) or 1 (on). In order of how often you'll need them:

ParameterTypeValuesDefaultDescription
contextstringCSS class namewhole <body>Element(s) to scan: every element with this class.
bareboolean0 | 11Also convert a supported link that sits alone on its line, without brackets.
modestringdom | block | htmldomHow the page is changed. dom replaces only the link itself and leaves everything else untouched. block rewrites only the paragraphs that contain a link. html rewrites the whole context at once (the 1.x behaviour), which removes other scripts' event handlers and widgets in it.
watchboolean0 | 10With mode=dom, also convert links added later (AJAX, infinite scroll, comments).
bstringcurly | square | parenthesescurlyBrackets that mark a link for embedding.
dmstringDailymotion Player IDnoneYour Player ID from Dailymotion Studio, required by Dailymotion since September 2026. Without it, Dailymotion links show a thumbnail that opens the video on Dailymotion.
rboolean0 | 11Responsive mode, with the auto-loaded stylesheet. With 0, embeds use the fixed w and h.
wintegerpixels320Embed width when r=0.
hintegerpixelsw × 9/14 (206)Embed height when r=0.
cstringCSS class nameuEmbedContainerClass of the element that wraps each embed.
devboolean0 | 10Skip the browser cache for the stylesheet and log each conversion to the console.

Providers

Links are matched by their domain, so m. and www. variants work too. Where a provider needs its own script (X, Instagram, Facebook, imgur, Tenor), it's loaded once, however many embeds use it.

ProviderLinks that workNotes
YouTubeyoutube.com/watch?v=…, youtu.be/…, /shorts/…, /live/…, /embed/…, youtube-nocookie.comShorts embed vertically. A t= or start= time (157, 2m37s) becomes the start position.
Vimeovimeo.com/…Via Vimeo's oEmbed, with the title as a caption.
Dailymotiondailymotion.com/video/…, dai.ly/…Needs dm for the inline player, otherwise a thumbnail link.
Glomexexchange.glomex.com/video/v-…?integrationId=…Paste the oEmbed URL from your Glomex account.
FacebookPosts: facebook.com/…/posts/…. Video: /videos/…, /reel/…, /watch?v=…Posts use Facebook's SDK, video uses Facebook's player.
Instagraminstagram.com/p/…Uses Instagram's embed script.
Xx.com/…/status/…, twitter.com/…/status/…Uses X's widgets script.
TikToktiktok.com/@…/video/…TikTok's own player, vertical.
Spotify (new)open.spotify.com/ track, album, playlist, artist, episode or show, including /intl-xx/ linksTracks and episodes get the compact 152px player, the rest the 352px one.
SoundCloudsoundcloud.com/…, playlists at /sets/…166px player for a track, 450px with a track list for a playlist.
Flickrflickr.com/photos/…, flic.kr/…The photo, linked to Flickr, with its title.
Giphygiphy.com/gifs/…
Tenortenor.com/view/…Uses Tenor's embed script.
imgurimgur.com/gallery/…, imgur.com/a/…Posts and albums. Single images aren't supported yet.

JavaScript

uEmbed.js runs by itself when it loads (or when the page finishes loading, if you put it in <head>). For content you add later, either turn on watch=1 or call it yourself:

// Convert links in content you've just added: a selector, an element or a NodeList
uEmbed.init('#comments');   // returns the number of embeds created

// Run your code after uEmbed.js has done its first pass
document.addEventListener('uembedLoaded', () => { … });

uEmbed.version;    // "2.0"
uEmbed.config;     // the options it's running with
uEmbed.providers;  // the provider list

Styling

Each embed is wrapped in a <div> you can style. uembed.css is added at the end of <head>, so to override it, use a slightly more specific selector (e.g. main .uEmbedContainer).

HookWhere
.uEmbedContainerEvery embed's wrapper (change it with c)
.embedIsVideo, .embedIsAudio, .embedIsImage, .embedIsGenericOn the wrapper, by kind of media
[data-uembed="youtube"]On the wrapper, the provider's name: youtube, vimeo, dailymotion, glomex, facebook, instagram, x, tiktok, spotify, soundcloud, flickr, giphy, tenor, imgur
.mediaIsYouTubeShorts, .mediaIsTikTok, .mediaIsSpotify, .mediaIsGlomexOn the iframe, for players with their own shape
.uEmbedThumbThe thumbnail card that links out (Dailymotion without dm)
.uEmbedPlaceholder, .uEmbedNotLoadedWhile an embed is loading, and if it fails

Changelog

From the first tagged release in 2020 to the 2.0 rewrite. Older releases stay available in releases/.

  1. 2.0

    New

    • Spotify: tracks, albums, playlists, artists, episodes and shows.
    • Links alone on their own line convert without brackets (bare=0 to turn off).
    • Links the editor turned into a link ({<a href…>…</a>}) convert too.
    • mode=: dom (new default) changes only the link, so other scripts keep working. block and html are also available.
    • watch=1 converts content added to the page later.
    • dm= for your Dailymotion Player ID, with a thumbnail card when there isn't one.
    • YouTube /live/, /embed/ and youtube-nocookie.com links, and start times from t=.

    Faster and lighter on the page

    • Now free and open source, under the MIT License.
    • Rewritten in modern JavaScript. The only global is window.uEmbed.
    • One pass and one write instead of rewriting the page once per embed: about 10 times faster on a long article, and earlier iframes no longer reload each time.
    • Third-party scripts (X, Instagram, Facebook, imgur, Tenor) are loaded once, after the page is updated. Fixes X's script loading once per post.
    • X posts no longer need an extra request before they render.
    • Works from <head> too: it waits for the page if needed.

    Fixed

    • Dailymotion: embeds without a Player ID now fail at Dailymotion's end (September 2026); uEmbed shows a working thumbnail instead.
    • twitter.com links used a retired X endpoint.
    • Embeds could spill out of narrow columns (audio and images had a 320px minimum).
    • SoundCloud playlists get the taller player with their track list.
    • Provider titles are escaped, and eval is gone.
    • Links are matched by domain, so text like “vimeo.com” in brackets no longer counts as a link.
    • The script's CSP nonce is passed to the scripts it adds. Facebook SDK updated to v26.0.
    • The stylesheet path works from any folder and file name.
    • dev takes 0 or 1 like the other switches (dev=0 used to turn it on).
  2. 1.11
    • Glomex video support.
  3. 1.10
    • YouTube Shorts, embedded vertically.
    • TikTok switched to TikTok's own player, with no extra script.
    • Iframes load lazily, as they scroll into view.
  4. 1.9
    • Embeds keep their full width even when a site's theme tries to shrink iframes.
  5. 1.8
    • x.com links, alongside twitter.com.
    • A clear “Error loading embed” message when an embed fails.
  6. 1.7
    • uEmbed.init(element) for content added after the page loads.
    • The uembedLoaded event.
    • dev=1 replaces the separate development build.
  7. 1.6
    • Facebook's root element is added without rewriting the page.
  8. 1.5
    • Provider scripts and lookups only run for links that matched a provider.
  9. 1.4
    • Tenor GIFs and Facebook Reels.
    • The stylesheet loads from the script's own folder, so uEmbed.js can be self-hosted.
    • Provider scripts are queued and added after the page is processed.
    • 500px support removed.
  10. 1.3
    • TikTok support.
    • context= to scan only part of the page.
    • New link matching, which needs a browser from 2019 or later.
    • MEGA TV support removed.
  11. 1.2
    • Giphy support (1.2.0).
    • Smaller script: the built-in XHR request code was removed (1.2.0).
    • Instagram embed sizing tweak (1.2.1).
  12. 1.1
    • First tagged release: YouTube, Vimeo, Dailymotion, Facebook, Instagram, Twitter, SoundCloud, Flickr, imgur, 500px and MEGA TV.
    • Options for brackets (b), responsive mode (r), size (w, h) and container class (c).