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.
| Path | Contents |
|---|---|
| manifest.json | Version, generator, animation list with loop and autoplay |
| animations/<id>.json | One Lottie animation per file |
| images/ | Image assets, when the animation carries them |
| Compression | Deflate, level 9 |
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.
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.
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.
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.
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.
The second gets a numeric suffix. Ids become paths inside the zip, so a collision would otherwise mean one animation quietly replacing the other.
No. The zip is built in your browser.
Yes — the dotLottie to Lottie tool unpacks it, and can re-inline the images so you get a single self-contained .json.
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.