HOSTING

Share a Lottie animation as a link

Put the Lottie JSON and the lottie-web player in one HTML file, upload it and send a link. The animation plays in any browser, with no After Effects, LottieFiles account or app on the viewer’s side.

4 min read·

A Lottie animation is a JSON file, usually exported from After Effects with the Bodymovin plugin or downloaded from LottieFiles. Sent as an attachment, it shows up as a page of code: the JSON needs a player to turn it into motion.

The fix is one HTML file that holds both the JSON and a player. Hosted at a link, it opens in any browser and the animation plays straight away, which is useful for sign-off on a loading spinner, an onboarding illustration or an animated logo.

Step 1: get the Lottie JSON

You need the animation as plain JSON text (the .json file), not the .lottie format.

  • ✓From After Effects: export with Bodymovin. If the animation uses images, choose the option to include them in the JSON so they travel inside the file.
  • ✓From LottieFiles: download the animation as Lottie JSON.
  • ✓A .lottie file is a zip archive. Convert it to Lottie JSON first, since the steps below paste JSON text into the page.

Step 2: put it in one HTML file

Create animation.html with these parts:

  • ✓<!doctype html>, <meta charset="utf-8"> and <meta name="viewport" content="width=device-width, initial-scale=1"> in the head.
  • ✓A style rule so the animation fills the window: html, body { margin: 0; height: 100%; } #anim { width: 100%; height: 100vh; }
  • ✓In the body: <div id="anim"></div>, then <script src="https://cdn.jsdelivr.net/npm/lottie-web@5.13.0/build/player/lottie.min.js"></script>.
  • ✓Then a second script: const animationData = followed by the full contents of your .json file and a semicolon.
  • ✓In the same script: lottie.loadAnimation({ container: document.getElementById('anim'), renderer: 'svg', loop: true, autoplay: true, animationData });
  • ✓Tested with lottie-web 5.13.0 in Chrome: a 60-frame rotation drew as an SVG and was mid-turn after 3 seconds of page time.

Why the JSON goes inside the page

lottie-web can also load the animation from a separate file with path: 'data.json' in place of animationData. That needs the JSON hosted next to the page at a matching address. Pasting it into the page keeps everything in the one file you upload, so there is nothing to keep in step.

The player script still comes from the jsDelivr CDN. To make the file work with no outside requests, paste the contents of lottie.min.js into a script tag in place of the src link. More on this: making an HTML file self-contained.

Upload it and send the link

Drag animation.html onto the FileShare Pro dashboard and copy the link. The animation plays in the browser, and viewers need no account.

Turn on comments and reviewers can leave a note on the page after typing a name, such as a timing change. When you export a new version, rebuild the file and upload it over the old one; the link stays the same: updating a shared link without changing it.

Other animations and graphics as one file: an SVG file, a p5.js or three.js sketch and an HTML game.

Frequently asked

How do I share a Lottie animation so anyone can watch it?

Put the Lottie JSON and the lottie-web player in one HTML file, upload it to a host and send the link. It plays in any browser with no app or account.

Can I share a .lottie file the same way?

Convert it to Lottie JSON first. A .lottie file is a zip archive, and the page in this guide reads JSON text.

Does the page need an internet connection?

Only to load lottie-web from the jsDelivr CDN. Paste the player script into the file to remove that request.

Is it free?

Yes. The free plan hosts up to 50 files of up to 100 MB each, with view counts and comments included. Password-protected links are on Pro.

Got a page to share?

Drop the file, copy the link — live in seconds, free plan included.

Start sharing free