# decimal.js: 7.5 out of 10

A strong pick. 1st of 8 in [Numbers and money](https://elestia.ai/opensource/numbers/index.md).

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.

## Scores

- **Overall: 7.5** (likely 6.5 to 8.5)
  - Claude Opus 5.5 (7.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.
  - GPT-6.2 Sol (8.0): 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 many: 5.6** (likely 4.4 to 6.8)
  - Claude Opus 5.5 (6.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): 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 lot: 8.2** (likely 7.1 to 9.1)
  - Claude Opus 5.5 (8.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): 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 time: 5.6** (likely 4.4 to 7.3)
  - Claude Opus 5.5 (5.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): 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 widely: 7.9** (likely 6.8 to 8.9)
  - Claude Opus 5.5 (8.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.
  - GPT-6.2 Sol (7.7): 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 for: 7.6** (likely 6.5 to 8.6)
  - Claude Opus 5.5 (7.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): 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.
- **Safe: 7.1** (likely 5.9 to 8.2)
  - Claude Opus 5.5 (7.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.
  - GPT-6.2 Sol (7.1): 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.

## 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

- Downloads, 4 weeks: 557M
- In a year: ×4.4
- GitHub stars: 7.3k
- Commits, 12 months: 4
- Last npm release: Jul 2025
- Advisories, 24 months: 0
- Licence: MIT
- GitHub: https://github.com/MikeMcl/decimal.js
- npm: https://www.npmjs.com/package/decimal.js

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
