# simple-statistics

> Simple Statistics

Latest version **7.12.0** (published 2026-09-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install simple-statistics
pnpm add simple-statistics
yarn add simple-statistics
bun add simple-statistics
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 7.12.0 |
| Published | 2026-09-08 |
| First published | 2012-06-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | * |
| Dependencies | 0 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 3520 |
| Author | Tom MacWright <tom@macwright.com> (https://macwright.com/) |
| Maintainers | tmcw |
| Keywords | descriptive, linear, math, probability, regression, statistics |

## Links

- npm: https://www.npmjs.com/package/simple-statistics
- Repository: https://github.com/simple-statistics/simple-statistics
- npm.io page: https://npm.io/package/simple-statistics

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 7.12.0 (latest) — 2026-09-08
- 7.0.9-alpha.0 (testing) — 2020-04-20
- 7.11.0 — 2026-08-29
- 7.10.2 — 2026-08-19
- 7.10.1 — 2026-08-14
- 7.10.0 — 2026-08-09
- 7.9.3 — 2026-07-03
- 7.9.2 — 2026-06-30
- 7.9.1 — 2026-06-26
- 7.9.0 — 2026-06-04
- 7.8.9 — 2026-03-10
- 7.8.8 — 2025-03-07
- 7.8.7 — 2024-10-16
- 7.8.6 — 2024-10-16
- 7.8.5 — 2024-08-27
- … 70 more at https://npm.io/package/simple-statistics/versions

## README

# Simple Statistics

A JavaScript implementation of descriptive, regression, and inference statistics.

Implemented in literate JavaScript with no dependencies, designed to work
in all modern browsers (including IE) as well as in [node.js](https://nodejs.org/).

* :green_book: [API Documentation](https://simple-statistics.github.io/)
* :chart_with_upwards_trend: [Benchmarks](./benchmarks/)
* :kissing: [A list of other statistics libraries](./SEEALSO.md)

## Installation

* **I'm using Node.js, Webpack, Browserify, Rollup, or another module bundler,
  and install packages from npm.**
  * First, install the `simple-statistics` module, using `npm install simple-statistics`,
    then include the code with require or import:
  * **I use the `require` function to use modules in my project. (most likely)**
    * When you use `require`, you have the freedom to assign the module to any
      variable name you want, but you need to specify the module's name exactly:
      in this case, 'simple-statistics'. The `require` method returns an object
      with all of the module's methods attached to it.<br /> <pre>var ss = require('simple-statistics')</pre>
  * **I use `import` to use modules in my project. I'm probably using Babel, `@std/esm`, Webpack, or Rollup.**
    * Import all functions under the ss object: <pre>import * as ss from 'simple-statistics'</pre>
      Include a specific named export: <pre>import {min} from 'simple-statistics'</pre>
      Simple statistics has _only_ named exports for ES6.
* **I'm using Deno.**
  * We recommend using Deno's first-class [NPM compatibility](https://docs.deno.com/runtime/fundamentals/node/) to use simple-statistics from NPM: you'll need to import it as `npm:simple-statistics`.
* **I'm not using a module bundler. I'm writing a web page, and want to include
  simple-statistics using a script tag.**
  * **I want to support all browsers**
    * When you use simple-statistics from a script tag, you don't get to choose
      the variable name it is assigned to: simple-statistics will always become
      available globally as the variable `ss`. You can reassign this variable to
      another name if you want to, but doing so is optional.
      ```HTML
      <script src='https://unpkg.com/simple-statistics@7.12.0/dist/simple-statistics.min.js'>
      </script>
      ```
  * **I want to use ES6 modules in a browser and I'm [willing to only support new browsers](https://caniuse.com/#feat=es6-module) to do it**
    * This module works great with the [`?module`](https://unpkg.com/#/query-parameters) query parameter of unpkg. If you
      specify `type='module'` in your script tag, you'll be able to import simple-statistics
      directly - through `index.js` and with true [ES6 import syntax and behavior](http://exploringjs.com/es6/ch_modules.html).
      ```js
      <script type='module'>
      import {min} from "https://unpkg.com/simple-statistics@7.12.0/index.js?module"
      console.log(min([1, 2, 3]))
      </script>
      ```
      This feature is still experimental in unpkg and very bleeding-edge.

---
_Source: https://npm.io/package/simple-statistics · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
