Skip to content

Maths.js Documentation

Simple statistical and numeric helpers for JavaScript.

Small API, big utility

Use compact methods like average, median, mode, gcd, lcm, clamp, and percentile.

Safe defaults

Input validation is built in and throws clear errors for invalid values.

Browser + Node

Use the global Maths object in browsers and require() in Node.

Quick setup

Start with the getting started guide and copy the usage snippets.

Complete reference

Browse all methods and examples in the API reference.