Skip to main content

Lottie Optimizer

Compress Lottie JSON files — recompress embedded images, trim numeric precision, and strip metadata. 100% client-side, your file never leaves your device.

Upload Lottie

Click to upload or drag and drop

Lottie JSON or .lottie (max 30MB)

No Lottie uploaded

Upload a Lottie JSON or .lottie file to compress it

Why optimize Lottie files?

Lottie files ship inside your app bundle or load on your webpage — every kilobyte counts against startup time and page speed. Yet exports from After Effects and conversion tools are full of dead weight: 12-decimal coordinates, layer names, generator metadata, and oversized embedded images.

This optimizer removes what players never use and recompresses what they do, typically cutting 20–60% off real-world files with no visible difference.

What it does

  1. Rounds coordinates to 2–3 decimals (exports carry 10+)
  2. Strips layer names, match names, and generator metadata
  3. Deletes hidden layers that never render
  4. Re-encodes embedded PNG/JPEG images as WebP
  5. Optionally downscales oversized embedded images

Frequently asked questions

Is this Lottie optimizer free?

Yes, completely free. No subscription, no watermark, no account required.

Is my Lottie file uploaded to a server?

No. All optimization runs in your browser. Your animation never leaves your device.

Will optimization change how my animation looks?

At the recommended settings (2 decimals, 80% image quality) the result is visually identical — coordinates in Lottie are in pixel units, so 2 decimals means sub-hundredth-of-a-pixel accuracy. The preview plays the optimized file so you can verify before downloading.

How much smaller will my file get?

Vector-only animations typically shrink 20–40% from precision trimming and name stripping. Files with embedded images can shrink 50–80% when PNG frames are re-encoded as WebP and downscaled.

Does it support .lottie (dotLottie) files?

Yes — .lottie archives are unpacked, optimized, and downloaded as standard Lottie JSON compatible with every player.

Is stripping layer names safe?

Yes for playback — players ignore names entirely. The optimizer automatically keeps names if it detects expressions that reference layers by name. Uncheck the option yourself only if your own code targets layers by name at runtime (e.g. dynamic text or color replacement).

Does this replace gzip compression on my server?

No — they solve different problems and stack together. Gzip/Brotli compress the file in transit over the network; this optimizer reduces the actual parsed JSON size and memory footprint at runtime. Use both for the best result.

Can I optimize a .lottie (dotLottie) file directly?

Yes. Upload the .lottie archive and it's automatically unpacked, optimized, and downloaded as standard Lottie JSON — compatible with every Lottie player.

Lottie file size optimization: where the bytes hide and how to reclaim them

Why Lottie exports are bigger than they need to be

Export tools optimize for correctness, not size. Bodymovin writes every coordinate with full floating-point precision — 128.48000000000002 where 128.48 renders identically. Every layer keeps its authoring name ("Shape Layer 47 copy 3"), every group its match name, and the file carries generator metadata no player reads. On a complex animation these overheads are thousands of occurrences; trimming them routinely removes a third of the file before touching anything visual.

Embedded images: the biggest lever

Animations converted from raster sources — like the output of our GIF to Lottie and MP4 to Lottie converters, or After Effects comps with image layers — embed their frames as base64 images. Those images usually dominate the file size. Re-encoding PNG frames as WebP at 80% quality halves them with no visible change, and downscaling a 1080px-wide embedded image that displays at 400px reclaims even more. The optimizer only keeps a recompressed image if it's actually smaller, so it can never make your file bigger.

What's safe to strip — and what isn't

Lottie players ignore nm (names), mn (match names), and meta during playback, so stripping them is free — unless your code manipulates the animation by layer name at runtime (dynamic text swaps, theme color replacement). In that case, uncheck "Strip layer names." Hidden layers (hd: true) never render and are pure dead weight from the authoring file — removing them is always safe. Numeric precision at 2 decimals is sub-pixel accurate; drop to 1 decimal only for large animations where a hundredth of a pixel truly cannot matter.

Page speed, app bundles, and when size matters most

A hero animation that loads with your landing page sits directly in the critical path — Core Web Vitals feel every extra 100KB. Mobile apps pay twice: bundle download size and memory at parse time. Optimizing before shipping is the single highest-leverage step, and it composes with delivery tricks like gzip (which your server applies on top). After optimizing, verify the result in the preview, then round-trip it through our Lottie to GIF or Lottie to MP4 converters if you also need shareable preview files.

Optimizer vs. gzip: why you need both

It's a common assumption that server-side gzip or Brotli compression already handles this — it doesn't, because it solves a different problem. Gzip compresses bytes in transit over the network; the browser still has to fully decompress and JSON.parse the entire file before lottie-web can render a single frame. A 2MB Lottie gzips down for the wire, but still costs 2MB of parse time and memory once it arrives. This optimizer shrinks the actual object — fewer bytes to parse, less memory held during playback — and stacks on top of whatever transport compression your server already applies. Use both together for the smallest real-world footprint.

Optimizing files from any source, including LottieFiles

This tool doesn't care where your Lottie came from — a download from the LottieFiles marketplace, a Bodymovin export from After Effects, or the output of our own GIF to Lottie and MP4 to Lottie converters all optimize the same way. Both .json and .lottie (dotLottie) files are accepted directly — no manual unzipping required for dotLottie archives.

Reading the before/after comparison

After optimizing, the result panel shows original size, optimized size, and percentage saved side by side, plus a live preview rendered from the optimized JSON — not the original — so what you see is exactly what you'd ship. If a file shows 0% savings, it's usually because it was already hand-optimized or is pure vector with no embedded images; try lowering the image quality slider or precision setting further, though at some point a small, well-authored vector Lottie simply has little left to trim.

Common problems and fixes

Optimized animation looks different from the original: check the preview carefully — if an expression-driven effect broke, the tool should have auto-detected and kept layer names, but re-run with "Strip layer names" unchecked to be safe. Savings are smaller than expected: the file likely has few or no embedded images — precision and metadata trimming alone typically save 20-40%, not 60%+, on pure vector animations. File won't upload: confirm it's under 30MB and a valid .json or .lottie — corrupted or partial exports will fail to parse. Everything runs client-side — no uploads, no accounts. See our full Lottie converter toolkit for every conversion direction in one place.

Support HuPNG

These tools are free to use and always will be. If they helped you, consider buying me a coffee — it directly funds hosting and new tools.