⚡ JavaScript Libraries for 2D Graphics

JavaScript libraries for 2D graphics are libraries used to create and control two-dimensional visual content and animations in web applications.

They typically support drawing and animating shapes, vectors, and particles on HTML5 Canvas or SVG, timeline-based animation control, interactivity, and performance-optimized rendering for dynamic visual effects.

⭐ Most Popular in 2026

The following chart shows the leading JavaScript libraries for 2D graphics in 2026, based on market share.

The most popular is Lottie with a share of 8%, followed by GSAP with 2.2% and Particles.js with 1.2%.

🚀 Country Highlights

Here is a list of libraries that are especially popular in certain countries.
Differences between global and country rankings are shown in parentheses.

✨ Best JavaScript Libraries for 2D Graphics

Below is a more detailed list of 17 JavaScript libraries for 2D graphics we detect, ranked by their market share.

Available filters: 2D-Graphics 3D-Graphics Animation Carousel CSS Data Grids DOM Editors Lightbox Scroll SPA State Utility UI
RankNameMarket share
1
Lottie
San Francisco, California, United States

An animation framework created by Airbnb that lets developers export Adobe After Effects animations as JSON and render them natively on mobile, desktop, and the web.

FreeOpen source
2
GSAP
San Francisco, California, United States

An open-source JavaScript animation library that enables developers to create high-performance, cross-browser animations for HTML elements, CSS properties, SVG, canvas, and JavaScript objects.

FreeOpen source
3
Particles.js

A lightweight JavaScript library for creating particles.

FreeOpen source
4
Anime.js
Paris, France

A lightweight JavaScript animation library with a simple yet powerful API.

FreeOpen source
5
Paper.js

An open-source vector graphics scripting framework that runs on top of the HTML5 Canvas.

FreeOpen source
6
Raphael

A JavaScript vector library for manipulating SVG graphics.

FreeOpen source
7
Fabric.js

A JavaScript canvas library with serialization and SVG-to-canvas/canvas-to-SVG parsers.

FreeOpen source
8
CreateJS

A suite of modular libraries and tools which work together or independently to enable rich interactive content on open web technologies via HTML5.

FreeOpen source
9
Pts

A lightweight and modular typescript library that comes with many useful algorithms for visualization and creative coding.

FreeOpen source
10
Rough.js

A small graphics library that lets you draw in a sketchy, hand-drawn style.

FreeOpen source
11
PixiJS

A rendering library with WebGPU/WebGL support for creating rich, interactive graphics and cross-platform applications and games.

FreeOpen source
12
Mo.js

An open-source, retina-ready, modular JavaScript motion graphics library.

FreeOpen source
13
p5.js
New York, United States

An open-source JavaScript library for creating interactive 2D and 3D graphics and visualizations.

FreeOpen source
14
Two.js

A two-dimensional drawing library with the the same API for SVG, canvas, and WebGL.

FreeOpen source
15
Rive
San Francisco, California, United States

A real-time interactive design and animation tool that helps teams create, run, and integrate interactive animations on any platform using open source runtimes.

Free$32+/seat/month
16
Phaser
San Francisco, California, United States

A fast 2D game framework with support for Canvas and WebGL rendering for building HTML5 games for desktop and mobile web browsers.

FreeOpen source$10+/month
17
Konva.js

An HTML5 Canvas JavaScript framework that enables high performance animations, transitions, node nesting, layering, filtering, caching, and event handling.

FreeOpen source
Data is based on the analysis of 3,320,789 websites.
Statistics were last calculated on .
For details, see our methodology and disclaimer.