Click here to buy secure, speedy, and reliable Web hosting, Cloud hosting, Agency hosting, VPS hosting, Website builder, Business email, Reach email marketing at 20% discount from our Gold Partner Hostinger You can also read 12 Top Reasons to Choose Hostinger’s Best Web Hosting
Before we get into the list, there’s one piece of news you need to know — especially if you’ve researched this topic before and remember GSAP having a complicated paid licensing structure.
The complete guide to best free JavaScript animation libraries in 2026 covers GSAP (now 100% free including all plugins), Anime.js, Motion, AOS, Three.js, Lottie, and 6 more. Code examples, use-case matching, and the licensing gotchas nobody else explains.
GSAP is now 100% free. All of it. Including every plugin that used to require a paid Club GreenSock membership — ScrollTrigger, SplitText, MorphSVG, ScrollSmoother, DrawSVG, the lot. Webflow acquired GreenSock in October 2024 and in May 2025 made the entire GSAP ecosystem free for everyone, including commercial use. The SplitText plugin was completely rewritten with a 50% file size reduction as part of the release.
Click here to check out Next.js JavaScript templates
This changes the conversation about JavaScript animation libraries significantly. The tool that was previously “obviously the best but the commercial licensing is complicated” is now simply the best — with no asterisk.
That said, GSAP isn’t the right answer for every project. This guide walks you through every major free JavaScript animation library, who each one is actually for, real code snippets you can use immediately, and an honest assessment of where each one falls short.

How to Use This Guide
Animation needs split into roughly four categories. Find yours and jump to the relevant section:
- Scroll-based animations (elements animating as the user scrolls): GSAP ScrollTrigger, AOS, Motion
- UI micro-interactions and transitions: Anime.js, Motion, GSAP core
- Creative / artistic animations: Mo.js, GSAP, Anime.js
- 3D and WebGL: Three.js, GSAP with WebGL
- React/framework-specific: Motion (formerly Framer Motion), React Spring, GSAP with @gsap/react
1. GSAP (GreenSock Animation Platform) — The Professional Standard, Now Free
License: Free for all use including commercial (as of May 2025) Size: Core ~27KB minified; plugins load separately GitHub Stars: 20K+ (gsap npm package: 12M+ sites) Framework support: Vanilla JS, React, Vue, Angular, Webflow, WordPress — everything
GSAP is the industry standard for professional JavaScript animation. Used on over 12 million websites, recommended by Google for high-performance animations, and now completely free including all previously paid plugins. If you’re serious about web animation, this is the library.
What Makes GSAP Different
The core of GSAP is a high-speed property manipulator that can animate literally anything JavaScript can touch — CSS properties, SVG attributes, canvas elements, WebGL, scroll position, arbitrary JavaScript objects, DOM attributes, colors, strings. It runs up to 20x faster than jQuery and consistently outperforms CSS animations in complex scenarios because it handles GPU acceleration, debouncing, and browser inconsistency automatically.
The timeline system is GSAP’s most powerful feature — it lets you sequence, overlap, nest, and control complex animation chains with precision that CSS transitions and simple JavaScript simply can’t match.
The Plugins (All Now Free)
- ScrollTrigger — The gold standard for scroll-based animations. Trigger animations based on scroll position with pinning, scrubbing, and snap effects. Previously a premium-only plugin.
- SplitText — Splits text into characters, words, or lines for precise text animation. Completely rewritten in 2025 with 50% file size reduction.
- MorphSVG — Morph between any two SVG shapes seamlessly.
- DrawSVG — Animate SVG strokes as if drawing them.
- ScrollSmoother — Smooth scrolling effect for the entire page.
- Flip — Animate layout changes using the FLIP technique automatically.
- MotionPath — Animate elements along a custom SVG path.
- Draggable — Make any element draggable with touch support.
Basic Code Example
// Install: npm install gsap
// Or CDN: // Simple tween — move element 200px right over 1 second
gsap.to(".box", { x: 200, duration: 1 });
// With easing and callback
gsap.to(".hero-text", {
opacity: 1,
y: 0,
duration: 0.8,
ease: "power3.out",
onComplete: () => console.log("Animation done")
});
// Timeline — sequence multiple animations
const tl = gsap.timeline();
tl.from(".header", { opacity: 0, y: -50, duration: 0.5 })
.from(".nav", { opacity: 0, duration: 0.3 }, "-=0.2")
.from(".hero", { opacity: 0, scale: 0.9, duration: 0.6 }, "-=0.1");
// ScrollTrigger — animate on scroll
import { ScrollTrigger } from "gsap/ScrollTrigger";
gsap.registerPlugin(ScrollTrigger);
gsap.from(".card", {
scrollTrigger: ".card",
opacity: 0,
y: 60,
duration: 0.7,
stagger: 0.15
});
The One Catch Worth Knowing
GSAP is free to use but not open-source. You can use it freely in any project including commercial ones — but you cannot fork it, decompile it, or build a competing animation library on top of it. For the vast majority of developers this distinction is entirely irrelevant. It’s worth knowing if you’re building something that requires an MIT or Apache license throughout your dependency chain.
Best for: Complex animations, professional projects, scroll storytelling, any project where animation quality is a priority. Now that it’s free with no licensing complexity, the question isn’t “can I afford GSAP?” but simply “do I need this level of power?”
2. Anime.js — The Lightweight Champion
License: MIT (fully open source) Size: ~6.2KB minified GitHub Stars: 66K+ npm downloads: ~319K/week
Anime.js is the most popular open-source JavaScript animation library by GitHub stars — and for good reason. It has a beautifully clean API, handles CSS properties, SVG, DOM attributes, and JavaScript objects, and does it all in a 6KB package.
What Makes Anime.js Different
While GSAP is the professional powerhouse, Anime.js wins on simplicity and bundle size. The API is expressive — you read the code and understand exactly what it does without needing to internalize a complex system. For projects where you need smooth, elegant animations without the full GSAP feature set, Anime.js is often the better choice.
Anime.js 4.0 (released in 2024) brought significant improvements including better performance, a cleaner API, and improved TypeScript support.
Basic Code Example
// Install: npm install animejs
// Or CDN: import anime from 'animejs';
// Simple animation
anime({
targets: '.box',
translateX: 250,
rotate: '1turn',
duration: 800,
easing: 'easeInOutSine'
});
// Stagger — animate multiple elements with delay
anime({
targets: '.card',
opacity: [0, 1],
translateY: [40, 0],
delay: anime.stagger(100), // 100ms between each
duration: 600,
easing: 'easeOutExpo'
});
// Timeline
const timeline = anime.timeline({
easing: 'easeOutExpo',
duration: 750
});
timeline
.add({ targets: '.el-1', translateX: 250 })
.add({ targets: '.el-2', translateX: 250 }, '-=600') // starts 600ms before previous ends
.add({ targets: '.el-3', translateX: 250 }, '-=600');
Best for: Projects where bundle size matters, clean open-source dependency requirements, SVG animations, developers who prefer an elegant simple API over GSAP’s comprehensive feature set.
Where it falls short: No built-in scroll trigger system (you’ll need Intersection Observer or a separate library for scroll animations). Smaller plugin ecosystem than GSAP. For very complex animations with precise sequencing control, GSAP’s timeline system is more powerful.
3. Motion (Formerly Framer Motion) — The React Developer’s Choice
License: MIT (open source) Size: ~85KB (tree-shakeable) GitHub Stars: 30.7K+ npm downloads: 3.6M/week
Motion is the most downloaded animation library in the React ecosystem by a significant margin. Originally developed as part of Framer’s design tool, it was open-sourced as Framer Motion and later rebranded as Motion to reflect its expansion beyond React.
What Makes Motion Different
Motion uses a declarative approach to animation — you describe what you want the component to look like, and Motion handles the transition. This aligns naturally with React’s component model and makes animation feel like a natural extension of your component logic rather than an imperative side effect.
The gesture system (hover, tap, drag, focus) is particularly strong — building interactive animated components that respond to user input is far more straightforward in Motion than in any other library.
// Install: npm install motion
import { motion } from 'motion/react';
// Basic animated component
function AnimatedCard() {
return (
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.4, ease: "easeOut" }}
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.98 }}
>
Card content
</motion.div>
);
}
// Scroll animation
import { useScroll, useTransform } from 'motion/react';
function ParallaxSection() {
const { scrollYProgress } = useScroll();
const y = useTransform(scrollYProgress, [0, 1], [0, -200]);
return (
<motion.div style={{ y }}>
Parallax content
</motion.div>
);
}
// AnimatePresence — animate elements when they leave the DOM
import { AnimatePresence, motion } from 'motion/react';
function Modal({ isOpen }) {
return (
<AnimatePresence>
{isOpen && (
<motion.div
initial={{ opacity: 0, scale: 0.9 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.9 }}
>
Modal content
</motion.div>
)}
</AnimatePresence>
);
}
Best for: React applications, component-level animations, gesture interactions, exit animations (AnimatePresence is unique), shared element transitions.
Where it falls short: Larger bundle size than Anime.js. Not the right tool for complex multi-step page animations (GSAP’s timeline handles this better). Vanilla JS support exists but React is where it truly shines.
36 (Brand New) Eye-Catching Free CSS Templates
4. AOS (Animate On Scroll) — The Simplest Scroll Animations on Earth
License: MIT (open source) Size: ~13KB JS + ~7KB CSS GitHub Stars: 27K+ npm downloads: ~200K/week
AOS is the fastest way to add scroll-triggered animations to any webpage. Where GSAP’s ScrollTrigger requires JavaScript configuration and Motion requires React, AOS adds animations through HTML data attributes — no JavaScript logic required beyond initialization.
Available animations include: fade, fade-up, fade-down, fade-left, fade-right, flip-left, flip-right, flip-up, flip-down, zoom-in, zoom-out, slide-up, slide-down, slide-left, slide-right.
Best for: WordPress sites, static HTML pages, any project where adding a scroll animation should take 5 minutes rather than 50. Absolutely the right tool for freelancers adding “nice scroll animations” to client sites efficiently.
Where it falls short: Limited to the predefined animation set — no custom animation logic. Not suitable for complex scroll storytelling (use GSAP ScrollTrigger for that). No programmatic control after initialization beyond reinitializing AOS.
3 Reasons to Choose Next.js Over React.js (And Why You Can’t Afford to Ignore It)
5. Three.js — The Gateway to 3D on the Web
License: MIT (open source) Size: ~600KB full build (tree-shakeable — import only what you use) GitHub Stars: 105K+ (one of the most starred creative coding libraries on GitHub) npm downloads: ~2M/week
Three.js is the gold standard for 3D graphics and WebGL in the browser. It wraps WebGL’s low-level complexity in a high-level API that makes 3D scenes, interactive experiences, and data visualizations accessible without a graphics programming background.
// Install: npm install three
import * as THREE from 'three';
// Basic scene setup
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
// Create a spinning cube
const geometry = new THREE.BoxGeometry(1, 1, 1);
const material = new THREE.MeshStandardMaterial({ color: 0x1E5FA8 });
const cube = new THREE.Mesh(geometry, material);
scene.add(cube);
// Add lighting
const light = new THREE.DirectionalLight(0xffffff, 1);
light.position.set(5, 5, 5);
scene.add(light);
camera.position.z = 5;
// Animation loop
function animate() {
requestAnimationFrame(animate);
cube.rotation.x += 0.01;
cube.rotation.y += 0.01;
renderer.render(scene, camera);
}
animate();
Best for: 3D product showcases, interactive data visualizations, WebGL-powered landing pages, games, portfolio effects, particle systems.
Where it falls short: Significant learning curve compared to 2D animation libraries. Bundle size requires careful code splitting. Not the right tool if you just need elements to fade in on scroll.
Pro tip: Three.js pairs naturally with GSAP — use Three.js for the 3D rendering and GSAP for coordinating camera movements, UI overlays, and scroll-triggered 3D interactions.
6. Lottie (by Airbnb) — Animate After Effects Exports on the Web
License: MIT (open source — lottie-web) Size: ~258KB (full), ~17KB (light version for simple animations) GitHub Stars: 31K+ npm downloads: ~900K/week
Lottie solves a completely different problem than the other libraries here. It renders animations exported from Adobe After Effects as JSON files — meaning designers can create animations in After Effects and developers can drop them into any web project without rebuilding them in JavaScript.
// Install: npm install lottie-web
import lottie from 'lottie-web';
// Load and play a Lottie animation
const animation = lottie.loadAnimation({
container: document.getElementById('animation-container'),
renderer: 'svg',
loop: true,
autoplay: true,
path: '/animations/loading-spinner.json' // Exported from After Effects
});
// Control playback
animation.play();
animation.pause();
animation.stop();
animation.setSpeed(1.5); // 1.5x speed
animation.goToAndPlay(30, true); // Jump to frame 30
Where to find free Lottie animations: LottieFiles.com has thousands of free animations. Many are genuinely high quality and cover common UI patterns — loading states, success/error indicators, empty states, onboarding illustrations.
Best for: Adding high-quality designer-created animations without rebuilding them in code, loading indicators, success/error feedback, onboarding animations, icon animations.
Where it falls short: You need After Effects to create custom Lottie animations (or use LottieFiles’ web editor). Not suitable for code-driven animation logic. File sizes vary — complex animations can be large.
Alternatives of Adobe Photoshop Express: 7 Best Free Browser‑Based Photo Editors
7. Mo.js — For Creative and Playful Micro-Interactions
License: MIT (open source) Size: ~35KB minified GitHub Stars: 18K+
Mo.js is a motion graphics library built specifically for UI micro-interactions and creative animations. Unlike libraries that animate existing DOM elements, Mo.js creates its own shapes and burst effects — perfect for button feedback, notification animations, and playful interactive elements.
// Install: npm install @mojs/core
import mojs from '@mojs/core';
// Burst animation — like a celebration effect
const burst = new mojs.Burst({
radius: { 0: 100 },
count: 8,
children: {
shape: 'circle',
fill: ['#E87722', '#1E5FA8', '#00875A'],
radius: { 6: 0 },
duration: 600,
easing: 'cubic.out'
}
});
// Trigger on button click
document.querySelector('button').addEventListener('click', function(e) {
burst.tune({ x: e.clientX, y: e.clientY }).replay();
});
Best for: Button click feedback, gamification effects, celebration animations, notification bursts, any UI moment that deserves a “delightful” animation rather than a simple transition.
Where it falls short: Mo.js hasn’t received major updates recently — the library is stable but not actively developed. Not suitable for layout or scroll animations. The unique coding style has a learning curve.
Top 4 Free Drag-and-Drop Website Builders That Let You Add Custom CSS
8. Popmotion — Physics-Based Animations
License: MIT (open source) Size: ~12KB minified GitHub Stars: 11K+
Popmotion is the underlying animation engine that powers Motion (Framer Motion). It provides low-level primitives for physics-based animations — spring dynamics, inertia, decay. If you want spring physics without the React dependency, Popmotion is the tool.
// Install: npm install popmotion
import { animate, spring } from 'popmotion';
// Spring animation
spring({
from: 0,
to: 300,
stiffness: 200,
damping: 15
}).start(x => {
element.style.transform = `translateX(${x}px)`;
});
// Generic animation
animate({
from: 0,
to: 1,
duration: 500,
onUpdate: latest => element.style.opacity = latest
});
Best for: Physics-based spring animations in vanilla JS, custom animation engines, when you want Motion’s spring physics without the React dependency.
5 Tools to Get a Notification When a Website Changes?
9. TailwindCSS Motion — Zero-JS Animations for Tailwind Projects
License: MIT (open source) Size: ~5KB pure CSS npm downloads: Rapidly growing
This is the newest entry on this list and arguably the most important trend in web animation right now. TailwindCSS Motion provides a utility-class animation system that requires zero JavaScript — just add classes to your HTML elements.
Best for: Tailwind CSS projects where you want simple animations without adding JavaScript dependencies. Extremely performant since it’s pure CSS.
Where it falls short: Limited to simple entrance/exit animations and presets. No scroll triggering, timeline control, or complex sequencing. Not the right tool for anything beyond basic UI transitions.
React: The Comprehensive Guide to Mastering React.js with Hands-on Examples
React.js makes developing dynamic user interfaces faster and easier than ever. Learn how to get the most out of the library with this comprehensive guide! Start with the basics: what React is and how it works. Then follow practical code examples to build an application, from styling with CSS to maximizing app performance. Whether you’re new to JavaScript or you’re an advanced developer, you’ll find everything you need to build your frontend with React!
10. Theatre.js — Visual Editor + Code Animation
License: Apache 2.0 (open source) Size: ~40KB GitHub Stars: 11K+
Theatre.js is unique on this list — it’s both a JavaScript animation library and a visual editor. You write the animation logic in code and then adjust the curves, timing, and values visually in a timeline editor, similar to After Effects but inside the browser.
Best for: Design-development collaboration, fine-tuning animation curves without guess-and-check code changes, complex animated sequences that require visual tweaking.
Where it falls short: Steeper setup than other libraries. The visual editor workflow requires understanding Theatre.js’s specific architecture. Smaller community and fewer learning resources.
The Quick-Pick Comparison Table
| Library | Size | License | Best For | Scroll Built-in | React Native | Skill Level |
|---|---|---|---|---|---|---|
| GSAP | ~27KB core | Free (all plugins) | Everything professional | ✅ ScrollTrigger | ✅ useGSAP | Intermediate |
| Anime.js | 6.2KB | MIT open source | Clean UI animations | ⚠️ Manual | ✅ Works | Beginner |
| Motion | 85KB | MIT open source | React animations | ✅ useScroll | ✅ Native | Beginner |
| AOS | 13KB | MIT open source | Quick scroll reveals | ✅ Built-in | ⚠️ Manual | Beginner |
| Three.js | ~600KB | MIT open source | 3D / WebGL | ⚠️ Manual | ✅ Works | Advanced |
| Lottie | 258KB | MIT open source | After Effects playback | ⚠️ Manual | ✅ Works | Beginner |
| Mo.js | 35KB | MIT open source | Micro-interactions | ❌ | ⚠️ Works | Intermediate |
| Popmotion | 12KB | MIT open source | Physics springs | ⚠️ Manual | ✅ Works | Intermediate |
| Tailwind Motion | 5KB CSS | MIT open source | Tailwind projects | ❌ | ❌ | Beginner |
| Theatre.js | 40KB | Apache 2.0 | Visual + code | ⚠️ Manual | ✅ Works | Advanced |
Which Library Should You Actually Use?
“I just want elements to fade in as the user scrolls my WordPress or HTML site” → AOS. Five-minute setup, data attributes, done. Don’t overthink it.
“I’m building a React app and need component animations and transitions” → Motion. It’s the standard for a reason. AnimatePresence for exit animations is something other libraries don’t match.
“I’m building a portfolio site with impressive scroll animations and want it to look professional” → GSAP + ScrollTrigger. Now that it’s completely free, there’s no reason not to use the industry standard. The learning investment pays off.
“I need a simple, lightweight library for UI micro-animations and I care about bundle size” → Anime.js. 6.2KB, MIT license, clean API. Ideal for when GSAP is overkill.
“I’m building a product landing page with a 3D model or interactive 3D element” → Three.js for the 3D, GSAP for orchestrating camera movements and scroll interactions.
“A designer gave me an After Effects animation file and said ‘put it on the website'” → Lottie. Export the After Effects file as JSON via the Bodymovin plugin, drop it in.
“I’m using Tailwind and want basic entrance animations without adding JS” → TailwindCSS Motion. Pure CSS, zero JavaScript, works instantly in any Tailwind project.
“I want button click effects and playful particle bursts” → Mo.js. Nothing else creates burst/particle micro-interactions this easily.
The “Should I Use CSS Instead?” Honest Answer
Modern CSS handles a lot of what used to require JavaScript. @keyframes, transition, animation, scroll-timeline, and view-transition cover a genuinely wide range of animation needs in 2026 — and CSS animations have zero JavaScript overhead.
Use CSS for: Simple transitions between states (hover effects, showing/hiding menus), loading spinners, basic entrance animations on page load.
Use JavaScript libraries for: Anything requiring timeline sequencing, scroll-triggered animations with complex triggers, physics-based spring animations, coordinated multi-element animations, SVG morphing, anything that needs programmatic control or user interaction.
The practical answer: use CSS first. If CSS becomes awkward or limiting, reach for a library. For most real-world projects, the answer ends up being: CSS for the simple stuff, GSAP or Anime.js for the interesting stuff.
38 Free Web, Mobile UI Kits And Wireframe Templates
Frequently Asked Questions
Is GSAP really free for commercial projects in 2026? Yes. Webflow acquired GreenSock in October 2024 and in May 2025 made the entire GSAP ecosystem — including all previously paid Club plugins like SplitText, MorphSVG, ScrollSmoother, and DrawSVG — completely free for everyone including commercial use. The one caveat: GSAP is free to use but not open-source, meaning you cannot fork or decompile it. For practical use in projects, it is fully free.
What’s the difference between GSAP and Anime.js? GSAP is the professional-grade option — more features, larger plugin ecosystem, better performance under complex scenarios, timeline-based sequencing, and battle-tested on 12M+ sites. Anime.js is lighter (6.2KB vs GSAP core’s 27KB), fully open-source MIT license, and has a cleaner simpler API. For small-to-medium projects where bundle size matters, Anime.js is often the better choice. For professional projects where animation quality is a priority, GSAP.
Which JavaScript animation library is best for React? Motion (formerly Framer Motion) is the standard choice for React with 3.6M weekly npm downloads. It’s declarative, integrates naturally with React’s component model, and handles exit animations (via AnimatePresence) better than any alternative. GSAP also works excellently in React via the official @gsap/react package — use GSAP if you need more complex timeline control or scroll animations.
Does AOS work with React or Next.js? Yes, but with some setup required. In Next.js, initialize AOS in a useEffect hook with an empty dependency array to run it after the component mounts. Reinitialize when route changes using Next.js router events. For complex React projects, Motion is usually more appropriate than AOS.
What replaced Framer Motion? Framer Motion was rebranded as Motion to reflect its expansion beyond React. It’s the same library, maintained by the same team, now available for vanilla JavaScript in addition to React. The npm package is now motion (though framer-motion still works as an alias).
Is Three.js good for beginners? Three.js has significant learning curve — you need to understand 3D concepts like scenes, cameras, lighting, geometry, and materials. The documentation and examples are good, but expect to invest real time before building anything non-trivial. If you want to add 3D to a project quickly, consider Spline (free tier) for simpler 3D scenes that can be embedded without Three.js knowledge.
Now loading...





