Skip to content
1001 Tools
sr
Math & education

Factorial Calculator

Enter a whole number to get its factorial — the product of every integer from 1 up to that number. Because factorials grow enormously fast, this tool computes them exactly with big-integer arithmetic, so even 100! is shown to the last digit, alongside a shorter scientific estimate.

Enter a non-negative whole number.

How it works

A factorial, written n!, multiplies together all whole numbers from 1 to n: 5! = 5×4×3×2×1 = 120. Each step multiplies by the next integer, so the value climbs steeply — 10! is already 3,628,800 and 20! passes two quintillion.

Ordinary calculators store numbers as double-precision floats, which stop being exact above 20!. This tool uses BigInt instead, multiplying whole numbers with no rounding, so the full result is exact no matter how long. Inputs must be non-negative whole numbers; the tool defines 0! as 1 and caps n at 10,000 to keep the page responsive.

Practical examples

Ways to arrange a bookshelf

Seven different books can be lined up in 7! = 5,040 distinct orders. Factorials count the arrangements (permutations) of a set of distinct items.

Where doubles lose accuracy

Enter 21. The exact answer is 51,090,942,171,709,440,000, but a normal calculator rounds the last digits. The exact-integer result here keeps every one of them.

A very large factorial

100! has 158 digits and is about 9.33 × 10¹⁵⁷ — larger than the estimated number of atoms in the observable universe. The tool still prints all 158 digits.

Frequently asked questions

What is a factorial?

The factorial of n, written n!, is the product of all whole numbers from 1 up to n. So 4! = 4×3×2×1 = 24. It counts how many ways a set of n distinct things can be ordered.

Why is 0! equal to 1?

There is exactly one way to arrange nothing — the empty arrangement — so 0! is defined as 1. It also keeps formulas like n! = n × (n−1)! consistent when n is 1.

Can I take the factorial of a decimal or a negative number?

Not with this tool. The plain factorial is defined only for non-negative whole numbers. Decimals and negatives are rejected. (A generalisation called the gamma function extends factorials to other numbers, but that is a different calculation.)

How large a number can I enter?

Up to 10,000. Beyond that the exact result would have tens of thousands of digits and slow the page down. Even at the limit, 10,000! is computed exactly.

Why do other calculators show 1.2676506e+30 for 30!?

They store the value as a floating-point number, which keeps only about 15–17 significant digits and shows the rest in scientific notation. This tool keeps the exact integer and also offers the scientific form as a convenience.

What is the factorial used for?

It underlies counting problems: permutations (orderings) and combinations (selections), probability, the binomial theorem, and Taylor series in calculus. Anywhere you count arrangements, factorials appear.

How is a factorial different from an exponent?

An exponent multiplies the same base repeatedly (2⁵ = 2×2×2×2×2), while a factorial multiplies a descending run of different numbers (5! = 5×4×3×2×1). Both grow fast, but factorials grow faster than any fixed exponent as n rises.

What does the digit count tell me?

It reports how many digits the exact answer has, which is a quick sense of scale. 25! has 26 digits; 50! has 65. It is handy when the full number is too long to take in at a glance.

Is the result exact or rounded?

Exact. Every digit shown is correct — there is no rounding. The scientific estimate beside it is rounded on purpose, for readability only.

Does anything get uploaded?

No. The factorial is computed in your browser with JavaScript BigInt. The number you enter never leaves your device.

Related tools