Elestia Open Source Ratings
7.5

decimal.js

A strong pick. 1st of 8 numbers and money.

decimal.js is a mature arbitrary-precision Decimal type with no dependencies and a full math API: exact arithmetic, rounding modes, exp/ln/trig and precision control. It is a strong, safe pick for exact decimal math today, but one person maintains it slowly, and it has no money or currency features.

Best for: Projects that need exact decimal arithmetic with set precision and advanced math functions, such as finance, pricing or scientific code.

WebsiteGitHubnpm

Scores

Overall7.5

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 7.0, likely 6.0 to 8.0

decimal.js is the most capable exact-decimal library in the category, with a clean security record and wide trust through Prisma, Math.js and jsdom. Maintenance by one person is slow and it lacks money and formatting features, which keeps it from being the default. bignumber.js from the same author is more active, and Dinero.js fits currency handling better.

  • peers bignumber.js commitsLastYear: 29 commits, versus 4 for decimal.js
  • npm-compare.com/big.js,bignumber.js,decimal.js,mathjs: Comparison placing decimal.js as the full-featured choice
  • npm downloadsLast4Weeks: Largest download volume in the category, growing slightly faster than the median

GPT-6.2 Sol: 8.0, likely 6.9 to 8.9

decimal.js is a strong choice for new projects that need configurable significant-digit precision and advanced decimal math. bignumber.js is a better fit for exact intermediate sums and products, and Dinero.js provides currency-aware allocation. Proven downstream use supports choosing decimal.js today, while the slow release cadence limits confidence in future fixes.

Needed by many5.6

How many developers need a tool for this job?

Claude Opus 5.5: 6.0, likely 5.0 to 7.0

Many business, e-commerce and finance apps need exact decimal math, but most projects do not. decimal.js covers the arithmetic part of the category, not formatting or currency handling. It runs in any JavaScript runtime.

GPT-6.2 Sol: 5.2, likely 3.8 to 6.5

Precise decimal calculations matter in billing, finance, database applications, and scientific software across browsers and servers. Built-in Intl.NumberFormat covers display-only needs, and integer minor units cover many simple money calculations. The share of developers who need a separate decimal library is hard to measure.

Helps a lot8.2

How well does it do the job for those who need it?

Claude Opus 5.5: 8.0, likely 7.0 to 9.0

It is the most complete decimal library of the peers: configurable precision, nine rounding modes, and exp, ln, pow and trig functions, with bundled types. The API is stable and well documented, and AI agents write correct code for it because examples are everywhere. Limits: it is not tree-shakable, its bundle is larger than big.js, it has no money type, and a few edge-case rounding bugs are open.

GPT-6.2 Sol: 8.3, likely 7.2 to 9.2

Version 10.6.0 combines a documented, typed API with nine rounding modes and advanced math. Most arithmetic rounds to 20 significant digits by default, so even typed code can lose digits in intermediate results. Error messages identify invalid arguments, though they use a generic Error type. A third-party microbenchmark shows faster alternatives for some operations, and performance depends on the workload.

Holds up over time5.6

Will it still be a good choice in two years?

Claude Opus 5.5: 5.0, likely 4.0 to 7.0

Only one person maintains it, without stated funding. It had 4 commits and no npm release in the last year (the last was 10.6.0, July 2025), and requests sit open for years. On the other hand, the code is mature, it avoids breaking changes, and Prisma, Math.js and jsdom depend on it, which makes it unlikely to disappear. The same author's bignumber.js had more activity this year.

GPT-6.2 Sol: 6.2, likely 4.8 to 7.5

The v10 API has been stable for years, and Math.js still builds on it. Four commits and zero releases in the last year point to slow maintenance, with several fixes awaiting review and more recent releases from bignumber.js. The visible npm publisher is a single account, and backup release access and funding are unclear.

Used widely7.9

How many use it, and is that growing?

Claude Opus 5.5: 8.0, likely 7.0 to 9.0

It has 557M downloads in 4 weeks, against 126M a year ago. That is a ratio of 4.4, a little above the 4.1 median, and the highest volume in the category. Most downloads come through other packages such as jsdom, Prisma and Math.js, so direct choices are far fewer. About 958k dependent repos is second only to big.js, which points to hundreds of thousands of projects.

  • npm downloadsLast4Weeks: 557M, up from 126M a year ago (ratio 4.4)
  • dependents repos: About 958k repos, versus 1.27M for big.js and 437k for bignumber.js
  • lightrun.com/answers/prisma-prisma-prismas-decimal-is-incompatible-with-decimaljs: Prisma's Decimal is based on decimal.js, which pulls it in transitively
  • jsdom package.json: jsdom lists decimal.js as a dependency, which inflates downloads through test runners

GPT-6.2 Sol: 7.7, likely 6.5 to 8.8

Downloads grew 4.41×, modestly ahead of the catalog median of 4.1×. Ecosyste.ms found about 958,000 dependent repositories, behind big.js and ahead of bignumber.js. Automated installs and downstream dependencies such as jsdom and Math.js inflate downloads, so growth in direct adoption remains uncertain.

Vouched for7.6

Who stands behind it being good?

Claude Opus 5.5: 7.0, likely 6.0 to 8.0

Major projects build on it: Prisma uses it for its Decimal type, Math.js for BigNumber, and jsdom depends on it. Independent comparisons and blog posts recommend it for precise math. It has no survey data, and its Hacker News and Bluesky presence is thin.

GPT-6.2 Sol: 8.1, likely 7.0 to 9.1

Math.js and jsdom use decimal.js, and Esko and HCL list version 10.6.0 in shipped products. Prisma also documents it for decimal and money calculations. These uses provide direct evidence of trust, while the State of JavaScript results offer no project-level satisfaction measure.

Safe7.1

How safe is it to depend on?

Claude Opus 5.5: 7.0, likely 6.0 to 8.0

It has zero dependencies, no advisories ever, the MIT licence and no supply-chain incidents. The OpenSSF Scorecard is low at 2.5: no branch protection, no security policy, no SAST and little code review. One maintainer controls publishing, so that account is a single point of risk.

  • advisories total: 0 advisories
  • npm dependencies: 0 dependencies
  • scorecard score: 2.5, with weak branch protection, security policy and code review

GPT-6.2 Sol: 7.1, likely 5.8 to 8.4

The MIT license, zero runtime dependencies, and clean OSV record support a low dependency risk. OpenSSF Scorecard gives it 2.5 out of 10, with weak code review and no detected branch protection or security policy. The checks give limited visibility into release safeguards, and there is little public evidence of how quickly a security fix would ship.

  • npm dependencies, npm license, and advisories total: Zero runtime dependencies, MIT license, and zero OSV advisories.
  • scorecard score and checks: 2.5 overall, code review 2, branch protection 0, and security policy 0.
  • github.com/MikeMcl/decimal.js/security: GitHub shows no security policy or published advisories.
  • github.com/ossf/scorecard/blob/main/docs/checks.md: Packaging and signing checks have limited visibility outside GitHub workflows and assets.

Good

  • Zero dependencies, MIT licence and no known advisories in more than ten years.
  • The richest API of the MikeMcl trio: rounding modes, precision control, exp, ln, pow and trigonometry.
  • Bundled TypeScript types, and BigInt support added in 10.5 and 10.6.
  • Prisma, Math.js and jsdom build on it, so a very large user base exercises it.

Bad

  • One maintainer: 4 commits and no release in the last year, with feature requests left open for years.
  • Not tree-shakable, and its bundle is larger than big.js (issue #162 is still open).
  • No currency, minor-unit or locale formatting support, so money apps must add these themselves or use Dinero.js.
  • Recent bug reports are still open: toFraction hangs with ROUND_FLOOR, exp is not correctly rounded near rounding boundaries, and one test file never runs.

The numbers

npm downloads, 4 weeks
557M ×4.4 in a year
GitHub stars
7.3k
Commits, 12 months
4
npm version
10.6.0 Jul 2025
Versions, 12 months
0
Advisories, 24 months
0 of 0 ever
OpenSSF Scorecard
2.5 out of 10, Nov 2026
Licence
MIT

Read on 21 November 2026 from GitHub (MikeMcl/decimal.js), npm (decimal.js), OSV and the OpenSSF Scorecard.

Numbers and money

  1. 7.5decimal.js
  2. 7.3bignumber.js
  3. 7.2Dinero.js
  4. 6.5big.js
  5. 5.8Math.js
  6. 4.4currency.js
  7. 3.8Numbro
  8. 3.2Numeral.js
Compare all 8 on six scores