Lottie to dotLottie

Turn Lottie JSON into a .lottie container. A dotLottie is a zip holding the animation, its playback defaults and any images, and because Lottie JSON is long repetitive text it typically compresses to around a fifth of the raw size — usually a far bigger win than any amount of JSON optimisation. Drop in one file or a dozen, set loop and autoplay per animation, and download a single bundle. Ids are slugified so they are safe as paths inside the archive, collisions get a suffix rather than overwriting each other, and if an animation points at images it does not actually contain, you are told before you download rather than after.

What goes in the container

PathContents
manifest.jsonVersion, generator, animation list with loop and autoplay
animations/<id>.jsonOne Lottie animation per file
images/Image assets, when the animation carries them
CompressionDeflate, level 9

When to use it

  1. Cut the payload of an animation on a landing page.
  2. Bundle a set of icon animations into one file.
  3. Ship a single asset to a mobile team instead of a folder.
  4. Reduce a Lottie that is too large for an ad format.
  5. Package animations with their loop and autoplay defaults baked in.

How to Use

  1. Drop in one or more Lottie JSON files.
  2. Set the id, loop and autoplay for each.
  3. Download the .lottie bundle.

Features

  1. One or many animations per bundle
  2. Per-animation id, loop and autoplay
  3. Maximum deflate compression
  4. Before and after size with the percentage saved
  5. Safe ids with collision handling
  6. Warns about images the bundle cannot carry
  7. Runs entirely in your browser

FAQs

What is a .lottie file?

A zip with a defined layout: a manifest listing the animations and their playback settings, the animation JSON under animations/, and any images under images/. Players that support it read the container directly; it is not a different animation format, just a better-packed one.

How much smaller is it?

Typically around a fifth of the raw JSON, sometimes better. Lottie JSON is highly repetitive text, which is exactly what deflate compresses well. This is normally a bigger saving than optimising the JSON itself — though doing both is better than either.

Can I put several animations in one file?

Yes, that is one of the container's actual advantages. Each gets its own id and its own loop and autoplay defaults, and a player selects between them by id.

What about my images?

Images already embedded in the JSON as data URIs travel with it. Images referenced as a relative path do not — the browser cannot read a file from your disk that you did not give it — so those are counted and listed before you download, rather than producing a bundle that renders with holes.

Which players open it?

The dotLottie web component, the dotLottie React and Vue packages, and the dotLottie players on Android and iOS. The older lottie-web on its own expects plain JSON, so keep a .json if you are targeting that directly.

What happens if two files have the same name?

The second gets a numeric suffix. Ids become paths inside the zip, so a collision would otherwise mean one animation quietly replacing the other.

Is anything uploaded?

No. The zip is built in your browser.

Can I go back to JSON?

Yes — the dotLottie to Lottie tool unpacks it, and can re-inline the images so you get a single self-contained .json.

Technical Details

A dotLottie is an ordinary zip with a fixed shape: `manifest.json` at the root listing the animations and their playback defaults, and `animations/<id>.json` for each one, with any image assets under `images/`. Building it is therefore a JSZip job, and the only decisions that matter are compression and ids. Compression is deflate at maximum rather than store, because Lottie JSON is exactly the input deflate is good at — long runs of repeated key names and digit sequences — and it typically lands at a fifth of the raw size, which is the entire reason the container exists. Ids become paths inside the archive, so a filename is slugified down to lowercase letters, digits, dots, hyphens and underscores; a name that reduces to nothing falls back rather than producing an empty path, and a collision between two files called the same thing is resolved with a numeric suffix rather than the second silently overwriting the first. Assets are the part worth understanding before packing. An image in a Lottie is either embedded, with `e: 1` and a base64 data URI in `p`, or external, with a relative path the player resolves against wherever the JSON lives. Embedded images travel with the animation and are packed as they are. External ones point at a file on the author's disk, which a browser cannot read — so rather than producing a bundle that renders with holes, the tool counts them and names them before you download. The output is served with the zip media type and a `.lottie` extension, which is what every dotLottie player expects. Everything happens in the page.

Lottie & Animation Tools

Lottie & Animation Tools

  • dotLottie to Lottie
  • Lottie Player & Embed
  • Lottie Color Editor
  • Lottie JSON Editor
  • Lottie to MP4
  • Lottie to GIF
  • Animated SVG to Lottie
  • SVG to Lottie