Guide

Lottie vs CSS animation

Everyone quotes the tradeoff; almost nobody shows it. So here is the same motion running in a real Lottie player and in exported CSS, side by side — and you can weigh both in your own browser.

Updated July 2026 · 4 min read · For designers & front-end developers

Short answer: for web UI, hero, and landing motion, CSS wins — no JavaScript player, a fraction of the weight, and editable code. Lottie wins when the same animation must also run in native iOS/Android apps, or when it's intricate vector art. The demo below makes the weight difference concrete.

The same animation, both ways — live

The source is one After Effects comp: a blue dot that pulses on a two-second loop, with an AE Glow on it. The right side is that comp exported to CSS — glow and all, running live. The left side is the same comp sent to a real Lottie player; it stays unloaded until you press the button, so you can watch what it costs to bring in — and notice what didn't survive the trip.

Lottie

real lottie-web player · glow not supported

Not loaded — 0 KB, 0 requests so far. Press play to see the exported result.

Exported CSS

native @keyframes · glow intact, no runtime

Running now — under 1 KB of CSS, 0 JavaScript, and the glow survives. Already on the page.

Same comp, same pulse — the difference is the glow. After Effects' Glow effect can't be exported to Lottie (lottie-web #764), so the Lottie dot arrives flat; the CSS export keeps the inner bloom and halo natively. Weight figures are measured live in your browser once you press play — on ae2css.com the player is served compressed (~46 KB gzipped); on a slower connection it can be more.

What those numbers mean

Even for a spin and a pulse, Lottie makes you ship its player — a JS runtime that downloads, parses, and rasterizes every frame on the main thread. The JSON here is under a kilobyte, so the cost is almost entirely the engine. CSS has no engine: the browser runs it on the compositor thread, so there's nothing to download and nothing competing with your JavaScript.

The Lottie player is a fixed tax you pay once per page, however small the animation — worth it when you're rendering something CSS genuinely can't, pure overhead when you're not.

Weight isn't all the flat dot gives away: the glow is gone because Lottie can't export it — nor drop shadows, blend modes, or luma mattes. What Lottie drops →

Point by point

 LottieCSS animation
Runtime shipped~46 KB gzipped playerNone
Extra requestsPlayer + JSONNone (inline CSS)
Renders onMain thread (JS)Compositor thread
Dev-editableNo — re-export from AEYes — plain code
Indexable / accessibleNo — opaque JSONYes — real DOM
AE effects (glow, shadow…)Dropped on exportKept
Crisp / responsiveYes (vector)Yes
Intricate vector artExcellentLimited
Runs in native appsYes (iOS/Android)*Web only

Lottie's real wins are the last two rows — dense vector art and native reach. Need neither, and you're shipping the runtime for nothing. * Native reach is real, but cross-platform parity isn't guaranteed — the same file can render differently per platform.

When each one wins

  • Choose CSS for buttons, loaders, hero and landing motion, scroll and hover effects — anything that lives only on the web and should stay light and editable.
  • Choose Lottie for intricate vector illustration, character animation, or any motion that must run in native iOS and Android apps from the same source.
  • Still unsure? Ask whether a front-end developer could plausibly have written the animation by hand. If yes, it belongs in CSS. See the fuller breakdown in the Lottie alternatives guide.

Getting CSS out of After Effects (without hand-coding)

Authoring CSS by hand is slow — matching keyframes and easing by eye. AE2CSS removes that: it reads your comp and writes the HTML/CSS directly, the same way it made the dot on the right. Same source you'd give Bodymovin, player-free output. Four steps:

  1. Install & open the panel in After Effects.
  2. Select layers and Analyze — the panel previews the exact result live.
  3. Export a small HTML/CSS folder: minimal DOM, unique IDs, no runtime.
  4. Drop it in — link the CSS, paste the markup, done.

FAQ

Is CSS animation better than Lottie?
For web UI, hero, and landing motion, usually yes — no JavaScript player, a fraction of the weight, editable as plain code. Lottie is better when the same animation must also run in native iOS/Android apps, or when it's intricate vector illustration.
How much does the Lottie player weigh?
The full lottie-web player is around 250 KB minified; the SVG-only build (lottie_light) is about 164 KB minified, ~46 KB gzipped. That runtime downloads and parses on every visit, on top of the animation's JSON. CSS adds zero runtime.
Does Lottie or CSS perform better?
CSS built on transform and opacity runs on the compositor thread with no JavaScript, so it stays smooth on low-end devices. Lottie rasterizes frames through its player on the main thread, which can drop frames when the file is heavy or the device is slow.
Can CSS do everything Lottie can?
No. Lottie renders intricate vector illustration — morphing shapes, hundreds of paths — that would be impractical in CSS, and it runs the same file in native apps. CSS covers the large majority of web UI and hero motion, which is where most Lottie files are actually used.
How do I convert After Effects to CSS instead of Lottie?
Export from the comp to HTML/CSS rather than to Lottie JSON. AE2CSS reads the comp and writes the markup and CSS directly — no player, no JSON — so the same source produces player-free web code.

Related guides

How to put an After Effects animation on a website Lottie alternative for web animation Lottie limitations

Ship the animation, not the player

Free during alpha. macOS, After Effects.

Download AE2CSS for macOS