Overview
Enter a whole number to calculate its factorial (n!) - the product of every whole number from 1 up to n. This uses JavaScript's native BigInt type for the calculation, so results stay exact even for large values where a regular floating-point number would lose precision (20! already exceeds what a standard JavaScript number can represent exactly). Useful for combinatorics problems, probability calculations, or checking schoolwork. Runs entirely client-side.
Best for: Calculating combinatorics or probability problems that involve factorials
How to use this tool
- Enter a whole number. Any non-negative integer, from 0 up to 5,000.
- Calculated with BigInt. Arbitrary-precision arithmetic keeps the result exact, no matter how large it gets.
- Copy the result. Grab the exact value with one click, formatted with digit-grouping commas.
Frequently asked questions
A standard JavaScript number can only represent integers exactly up to about 9 quadrillion, and factorials grow extremely fast - 20! is already over 2 quintillion. Beyond that point, regular floating-point math would silently round the result. BigInt represents integers of any size exactly, so the result stays precise no matter how large n gets.
Factorials grow so quickly that 5,000! already has over 16,000 digits - past that, the result becomes too large to display or copy usefully, even though the math itself would still be exact.