About the Factorial Calculator
This tool computes n! for non-negative integers and shows the full integer when possible. You type n and results update instantly with no calculate button. The product is computed exactly with arbitrary precision arithmetic up to n = 5,000. For larger n the tool uses the Stirling series for ln n! to give a reliable scientific estimate and a digit count. The page also reports trailing decimal zeros by counting factors of 5. All computation runs in your browser, so you do not upload numbers to a server. That keeps your input private and lets the tool work offline. You can copy the full digits, download them, or share a link that reopens this page with your input. Sources include the NIST DLMF for Stirling and Mathisfun for the basic definition.
How to use it
- 1Enter a non-negative integer n in the input field.
- 2Watch n!, scientific notation, digit count and trailing zeros update as you type.
- 3Use the copy button to copy the exact integer or scientific form.
- 4Share the page link to reopen this tool with your number.
Worked example
Input: 20 Exact result: 2432902008176640000 Digits: 19 Trailing zeros: 4
The formula
n! = 1 x 2 x 3 x .x n, and 0! = 1Up to 5,000 the product is worked out exactly with big integersAbove that the size comes from Stirling's series, ln n! = n ln n - n + ln(2 pi n) / 2 + 1 / (12n) - .Trailing zeros = n/5 + n/25 + n/125 + .(whole parts only), because each zero needs a factor 5 paired with a 2Source: NIST DLMF - Stirling series and GammaMathisfun - Factorial definition and examplesFreeToolr - Factorial Calculator. Last checked 6 November 2026.
What it is good for
- Exact full integer output for n up to 5,000.
- Instant results in your browser with no upload.
- Copy, download or share a link that reopens your input.
- Exact digits are shown only up to n = 5,000; larger n use Stirling estimates.
- Input must be a non-negative integer up to 1,000,000; non-integers are not computed here.
Questions people ask
What input does this tool accept?
Enter a non-negative whole number. The tool accepts integers up to 1,000,000 but shows exact digits only up to 5,000. Decimal or negative inputs are rejected here.
Why does the page show only an estimate for very large n?
Exact n! grows too large to display for very big n. For n above 5,000 the tool uses Stirling's series to estimate ln n! and produce scientific notation. See the NIST DLMF for the series.
How does the tool count trailing zeros?
It uses Legendre's formula for powers of 5: floor(n/5)+floor(n/25)+floor(n/125)+... until terms are zero. Each trailing zero needs a factor 5 paired with a factor 2.
Is my input sent to a server?
No. All computation runs in your browser. You do not upload numbers to a remote server unless you explicitly share a link or download the result.
Can I compute 4.5! here?
No. This tool computes factorial only for whole numbers. For non-integers use the Gamma function, which satisfies Gamma(n+1)=n!. See the NIST DLMF for details.
How do I copy or save the full result?
Use the copy button to place the exact integer or scientific form on your clipboard. You can also download the digits as a local file if you need them.
Help keep every tool free
FreeToolr stays free because people help it grow. Share a tool you like, tell us what to build next, or support us on Ko-fi.