Lottie compressor

Make Lottie JSON and dotLottie files smaller without changing how they look. Images are re-encoded only when the result is visually identical, and everything runs in your browser.

Drop a Lottie .json or .lottie file

If the JSON uses external images, drop it together with its image files. Files are processed on your device and never uploaded.

Mode

Shrinks each image as far as it can while it still looks the same. Images that would show banding stay lossless.

Output
Advanced

What it does to your file

A Lottie file has two parts: the animation data (layers, shapes and keyframes) and the images. In most heavy files the images are the problem. A splash screen we tested held five PNGs that made up 97% of its 6.4 MB. Compression brought it to 3.2 MB without touching a single keyframe.

  1. Every image gets several candidate encodings. These are lossless PNG optimisation (oxipng), a 256-colour palette PNG with dithering (the pngquant approach), and JPEG for images with no transparency.
  2. Each candidate is scored against the original. The score is PSNR over the visible pixels. Transparent areas are skipped, so a mostly empty overlay can't score well just because it is mostly empty.
  3. The smallest candidate that passes your quality guard wins. If none passes, the image stays lossless. This guard is why soft gradients and skies don't come back banded.
  4. The JSON gets lossless cleanup. Duplicate images are merged and assets no layer uses are dropped. Editor metadata goes, and the whitespace is minified.

Pick a mode

ModeUse it whenTypical saving
SmartYou want the smallest file that looks the same. This is the default.40–80% on image-heavy files
LosslessEvery pixel must stay identical, for example for brand assets or legal sign-off.10–25%
Target sizeA store, CMS or bundle sets a hard limit, such as 4 MB.Whatever it takes, least visible quality first

Things that catch people out

  • File size isn't memory. A 1355×2786 PNG takes 15 MB of RAM once decoded, whether the file is 2 MB or 300 KB. If an animation stutters on low-end Android, reduce the image's pixel dimensions. Compression won't fix that.
  • Gzip already helps on the web. Servers send JSON gzipped, but base64 images barely compress further. The download stays big until the images themselves shrink.
  • Swapping images by id at runtime? Merging duplicates points layers at one shared asset id. If your app replaces images by asset id (an image asset delegate), turn off Merge duplicate images.
  • Layer names matter to code. Dynamic properties (KeyPath on mobile) and expressions find layers by name, so names are kept unless you strip them.

Want to know why the file is heavy first? Open it in the Lottie Inspector. For the full background, read why Lottie files get so big.

Questions

Will compressing my Lottie change the animation?

No. Keyframes, easing, layers, timing, markers and precomps are copied exactly. Only embedded images are re-encoded, and only when the result still looks the same. Lossless mode leaves every pixel identical too.

Are my files uploaded anywhere?

No. Compression runs in your browser with WebAssembly. Your file never leaves your device, so it is safe for unreleased or client work. Once the page has loaded, it also works offline.

Why is my Lottie JSON so large?

Almost always because of embedded images. After Effects exports them as base64 PNGs inside the JSON, and base64 adds 33% on top of the image size. In a typical image-heavy splash animation, images make up over 95% of the file.

Does the compressed file work with lottie-android, lottie-ios, React Native and Flutter?

Yes. Output stays standard Lottie JSON with PNG or JPEG images, which every player supports. WebP is off by default because iOS shows it only from iOS 14.

How do you know an image still looks the same?

Each image is encoded several ways and compared with the original pixel by pixel (PSNR over visible pixels). An encoding is used only if it passes the quality guard you picked. Otherwise the image stays lossless. Smooth gradients, which band easily, usually stay lossless.

Can I compress to a specific size, like under 4 MB?

Yes. Pick Target size and enter a limit. The tool starts lossless, then gives up the least visible quality first until the file fits. If the target can only be reached by resizing images, it tells you so.

Should I use JSON or dotLottie?

dotLottie (.lottie) is a ZIP that stores images as plain files and compresses the JSON, so it is usually much smaller. lottie-android, lottie-ios, lottie-react-native and the dotLottie web player all read it. Keep JSON if your pipeline or player expects it.