UTILS.
Private by default
!

Factorial Calculator

Compute n! exactly for large n using big integers, with a digit count.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

Factorial Calculator computes n!, the product of every whole number from 1 up to n, exactly, using JavaScript BigInt arithmetic instead of floating-point numbers. Ordinary numbers cannot hold the exact value of the factorial once it passes 18!, and calculators fall back to scientific notation, but this tool prints every digit. 20! is 2,432,902,008,176,640,000, and 100! runs to 158 digits.

Enter a whole number from 0 to 5,000. The full result appears in the result box with a digit count underneath, and the Copy button copies all the digits. 5,000! has 16,326 digits, so very large answers fill the box and need scrolling. Anything above 5,000 gets a message that the number is too large; the cap keeps the page responsive while the product is calculated. A blank box, a negative number, a decimal or any non-numeric entry simply leaves the result empty instead of showing a number.

By convention 0! and 1! are both 1. Factorials are defined here only for non-negative integers; the gamma function extends them to fractions, but that is not what this tool computes. Factorials count the ways of arranging n distinct items, so they appear in permutations, combinations and probability, and they grow faster than exponential functions, which is why the digit count climbs so quickly.

Frequently asked questions

What is the largest input?
Inputs are capped at 5,000 so the browser stays responsive; larger values are rejected with a notice.
What is 0!?
By convention 0! equals 1, the empty product, and the calculator returns 1 for an input of 0.
Why is the result empty for my input?
The tool accepts whole numbers from 0 upward only. Decimals, negative numbers, values like 1e3 and blank input leave the result empty.
Why use BigInt?
Standard numbers keep about 15 to 16 significant digits, so large factorials would be rounded. BigInt keeps every digit exact.

More tools