# bignumber.js: 7.3 out of 10

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

bignumber.js is a mature, zero-dependency library for exact decimal arithmetic, with its precision set in decimal places. It also does base conversion and formatting. It is a solid, actively maintained pick for exact math today, but v10 and v11 in early 2026 changed how it handles invalid input, so plan for that when you upgrade older code.

**Best for:** Projects that need exact decimal math with fixed decimal places, built-in number formatting or non-decimal bases, and do not need a full money model.

## Scores

- **Overall: 7.3** (likely 6.2 to 8.3)
  - Claude Opus 5.5 (7.0): It is a strong, actively maintained choice for exact decimal math, especially when you want decimal-place precision and formatting in one zero-dependency package. decimal.js has more users and more math functions, big.js is smaller for simple needs, and Dinero.js is better when you need a real money model. The 2026 breaking changes and the single maintainer keep it out of the top tier.
  - GPT-6.2 Sol (7.5): Pick bignumber.js when exact decimal totals, explicit rounding, and custom number formatting belong in one small library. Dinero.js is a better fit for modelling currencies and allocating amounts, and decimal.js covers more scientific math. The unreleased rounding fix and reliance on one publisher keep bignumber.js from being the default across the category.
- **Needed by many: 4.8** (likely 3.7 to 5.9)
  - Claude Opus 5.5 (5.0): Exact decimal math matters in finance, e-commerce, crypto and data work, but many web apps never need more than native numbers or Intl.NumberFormat. bignumber.js is general-purpose and runs in any runtime. That puts it at the middle of the scale.
  - GPT-6.2 Sol (4.5): Exact arithmetic matters for billing, financial data, and other precision-sensitive work, and the library works in browsers and on servers. Built-in Intl.NumberFormat covers many display-only needs. The share of projects that also need arbitrary precision is hard to measure.
- **Helps a lot: 7.6** (likely 6.5 to 8.6)
  - Claude Opus 5.5 (7.5): It is a precise, well-tested library with complete API docs, bundled types and rich formatting. The 2026 releases added strict input checks, toBigInt, fromFormat and better formatting. It has no money abstraction and no log or trig functions. A few small open bugs remain, such as toFraction hanging under ROUND_FLOOR and toString(base) under-rounding for odd bases.
  - GPT-6.2 Sol (7.7): Version 11.1.5 combines exact basic arithmetic with configurable division, custom formatting, and a documented, typed API. The published build still has the zero-rounding bug, and decimal.js covers more scientific functions. The available comparison uses older versions, so current relative speed and coding-agent accuracy are uncertain.
- **Holds up over time: 6.6** (likely 5.2 to 7.7)
  - Claude Opus 5.5 (6.5): It was very active in 2026, with two majors, many patch releases and 29 commits, and issues are handled quickly. The risks are one maintainer with no visible funding and two breaking majors close together. The project is 14 years old and other libraries depend on it widely, so it is unlikely to vanish.
  - GPT-6.2 Sol (6.6): The project made 29 commits and published 10 npm versions over the past year, ahead of big.js and decimal.js on recent release activity. The August rounding fix is still awaiting an npm release, and Taquito needed compatibility changes when it upgraded to v10. One listed npm maintainer and limited public information about funding or backup publishers widen the range.
- **Used widely: 6.8** (likely 5.7 to 7.8)
  - Claude Opus 5.5 (7.0): It has 360M downloads in 4 weeks, up 4.1x from a year ago. That matches the 4.1 median, so it is holding ground, not gaining. Much of the volume is transitive, through packages such as json-bigint and database drivers. Its 437k dependent repos are fewer than decimal.js (958k) and big.js (1.27M), but still show hundreds of thousands of projects.
  - GPT-6.2 Sol (6.6): ecosyste.ms found about 437,000 dependent repositories and 7,230 packages, with both decimal.js and big.js ahead on repository count. Downloads grew 4.095× year over year, just below the 4.1× catalog baseline and behind decimal.js at 4.41×. Popular dependencies pull in v9, and npm's version breakdown makes it hard to infer how many new projects choose v11.
- **Vouched for: 6.5** (likely 5.2 to 7.6)
  - Claude Opus 5.5 (6.0): Thousands of published packages, including widely used JSON, database and blockchain SDKs, build on it, and independent comparisons recommend it for financial work. It does not appear in developer surveys, and there are no current benchmarks or Hacker News or Bluesky discussion. Most of the validation is indirect and old.
  - GPT-6.2 Sol (7.0): Google Cloud's Node.js metadata client uses BigNumber for large values, and the Taquito SDK integrated v10 into its shipped packages. These integrations establish real use, while the independent benchmark covers older releases. The State of JS tools survey gives no satisfaction measure for the library, and independent evidence specific to v11 remains limited.
- **Safe: 7.1** (likely 6.0 to 8.2)
  - Claude Opus 5.5 (7.5): It has zero runtime dependencies, an MIT licence and no advisories ever recorded. The OpenSSF Scorecard is weak at 2.9: no branch protection, no security policy, unpinned dependencies, no SAST, and releases by one person without review. Those process gaps lower the score despite the clean record.
  - GPT-6.2 Sol (6.6): The MIT licence, zero runtime dependencies, and clean OSV record keep dependency risk relatively low. The 2.9 OpenSSF Scorecard flags weak branch protection and review, unpinned workflow dependencies, broad token permissions, and a missing security policy. One listed npm maintainer and limited public evidence about how releases are verified leave uncertainty about publishing safeguards.

## Good

- Zero dependencies, MIT licence, and no published security advisories in about 14 years.
- Precision is set in decimal places, which fits financial rounding, and the library offers 9 rounding modes.
- Built-in toFormat, fromFormat, toFraction, toBigInt and base 2-64 conversion cover formatting and parsing as well as arithmetic.
- Ships separate ESM, CommonJS and browser builds with bundled TypeScript types.

## Bad

- Two major versions in 2026 (v10, v11) made invalid input throw by default, which can break code that expected NaN.
- One maintainer does almost all the work, with no visible funding.
- It has no money or currency model; Dinero.js handles currencies, allocation and scale for you.
- It lacks non-integer powers, logarithms and trig functions, which decimal.js has.

## The numbers

- Downloads, 4 weeks: 360M
- In a year: ×4.1
- GitHub stars: 7k
- Commits, 12 months: 29
- Last npm release: Jul 2026
- Advisories, 24 months: 0
- Licence: MIT
- GitHub: https://github.com/MikeMcl/bignumber.js
- npm: https://www.npmjs.com/package/bignumber.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.
