DEV Community

Fazal Shah
Fazal Shah

Posted on

dotLottie vs Lottie JSON: Which Should You Use in 2025?

Two formats exist for Lottie animations: the original .json (Lottie JSON) and the newer .lottie (dotLottie). They render identically in the browser — but one is dramatically smaller. Here's when to use each, and how to switch.


TL;DR

  • .json — use when maximum tooling compatibility matters
  • .lottie — use for everything else. 75% smaller, faster, supports multiple animations per file

What Is Lottie JSON?

.json is the original format from Airbnb's Bodymovin plugin. Plain text JSON describing every layer, shape, keyframe, and property.

  • Human-readable
  • Universal support
  • Editable with IconKing

What Is dotLottie (.lottie)?

A ZIP archive containing the Lottie JSON + assets.

  • Same spinner: ~25KB JSON vs ~7KB dotLottie (72% smaller)
  • Multiple animations in one file
  • Embedded fonts/images
  • Metadata baked in

Size Comparison

Animation .json .lottie Savings
Loading spinner 24KB 6KB 75%
Success checkmark 18KB 5KB 72%
Hero illustration 145KB 38KB 74%

Converting

IconKing converts .json ↔ .lottie in the browser:

  1. Go to iconking.net
  2. Drop your file
  3. Click convert + download

No account, no upload limit, fully client-side.


Migrating React

// Before: lottie-react
import Lottie from 'lottie-react';
<Lottie animationData={animData} loop autoplay />

// After: dotlottie-react
import { DotLottieReact } from '@lottiefiles/dotlottie-react';
<DotLottieReact src="/animations/animation.lottie" loop autoplay />
Enter fullscreen mode Exit fullscreen mode

When to Use Each

Use .json when:

  1. Using lottie-web/lottie-react directly and don't want to swap libraries
  2. CMS plugins that only support .json
  3. Programmatic manipulation with addValueCallback

Use .lottie when:

  1. New projects
  2. Mobile apps (meaningful bandwidth savings)
  3. Multiple animations in one file
  4. Core Web Vitals matter

Summary

.json .lottie
File size Larger ~75% smaller
Compatibility Universal Growing
Multiple animations No Yes
Best for Legacy projects New projects, mobile

If you're starting fresh: use .lottie. Convert at IconKing.

Top comments (0)