v4 is here! Read all about it here.

Build dApps on any EVM Chain with TypeScript
Libraries

Build dApps on any EVM Chain with TypeScript Libraries

Trusted by
AriseHealth logoOE logo2020INC logoThe Paak logoEphicient logoToogether logoToogether logo
Made with  💛  by  ChainSafe Systems

Why Web3.js?

Web3.js was established in 2014, making it the oldest web3 library. With extensive documentation, an active community and modular design, Web3.js is powerful and easy-to-use.
2M
monthly npm usage
2M
monthly CDN requests
500K
Weekly downloads
19K
GitHub stars
3K+
Dependent projects

With Web3.js, you can

Deploy and interact with smart contracts as TS/JS objects
Interact with the Ethereum Name Service (ENS)
Get block and state information from Ethereum nodes
Subscribe to specific on-chain or smart contract events
Create and import accounts, sign data and transactions
Have access to utilities with built-in helpers for Ethereum dApps and web3 packages
Step 1. Import Web3 module.
Import {Web3} from “web3”
Step 2. Initialize provider.
Const web3 = new Web3(“provider_url”)
Step 3. Get the current block number.
Const blockNumber = await web3.eth.getBlockNumber()

Web3.js Features

Abstractions over the JSON-RPC API
Simplifying interaction for your Developer Experience.
Dynamic contract types and full API in TypeScript
Enforced with strict types for enhanced security and safety.
Most efficient ABI Encoder & Decoder
Include only what you need during bundling for optimized performance.
ESM and CJS module builds
Support for both ECMAScript module and CommonJS module builds for flexible integration with various project setups.
Custom Output formatters
Format any returned value to be a string, number, BigInt, etc., providing flexibility in handling output data.
Language aligned
to the official Ethereum terminology

“At Chainstack, Web3.js has been instrumental in developing our RPC API documentation and tutorials. Its robust features and seamless integration allow us to showcase use cases effectively, enabling developers to leverage the full potential of blockchain technology quickly. Web3.js is a foundational tool that enhances our ability to support developers in building scalable and innovative applications on multiple blockchains.”

“Developing the Namespace ENS plugin for Web3.js was a smooth experience. Developer docs are concise and easy to follow, and their SDK made the process even more frictionless. On top of that, the DevRel team was always available to provide any support if needed.”

“We've been relying on Web3.js to build DeFi Saver since 2020. With us having built a lot of custom infra in-house, Web3.js had been a great tool for this purpose. The API has been stable and it provided us enough visibility and control over the entire stack. It's also been here for a while and all the tooling around it is stable and ready, so there's hardly ever any issues.”

Tell us how you use Web3.js

The latest updates

Embracing Innovation Through Hackathons

In Web3 development, innovation is critical to...

A Beginner's Guide to Web3.js

Curious about the world of web3 development? If you're a beginner coder or a web developer...

Mastering Web3.js utilities

The web3.js utilities package is one of the most widely used packages of the web3.js...