Factorial Calculator

Enter a non-negative whole number to compute its factorial n! exactly. The calculator uses big-integer arithmetic, so even large factorials are precise to the last digit. It also shows the expansion and, for big results, the digit count.

Enter a whole number, then press Compute factorial.

What a factorial is

The factorial of a non-negative whole number n, written n!, is the product of every whole number from 1 up to n. It counts the number of ways to arrange n distinct items in order, and it appears throughout combinatorics, probability and calculus.

n! = n × (n − 1) × (n − 2) × ... × 2 × 1

By definition 0! = 1 (there is exactly one way to arrange nothing), and factorials are only defined for non-negative whole numbers. Each step multiplies the running total by the next integer, so n! grows extremely fast.

Worked example

Compute 5!:

Expand: 5 × 4 × 3 × 2 × 1.
Multiply step by step: 5 × 4 = 20, × 3 = 60, × 2 = 120, × 1 = 120.
Result: 5! = 120 - the number of orderings of five items.

Large values and precision

Factorials explode: 13! already exceeds a billion, and 21! overflows a normal 64-bit number. This calculator uses BigInt arithmetic, so the answer is exact no matter how many digits it has - 100! is shown in full, all 158 digits of it. For very large n the result is also summarised by its digit count and scientific-notation form so it stays readable. Everything is computed in your browser.

Tip: counting arrangements or selections? Use the permutation & combination calculator, which builds on factorials.

Frequently asked questions

What is 0 factorial?

0! equals 1 by definition. There is exactly one way to arrange an empty set - the empty arrangement - so the convention keeps formulas in combinatorics consistent.

Can I take the factorial of a decimal?

Not with this tool. The ordinary factorial is only defined for non-negative whole numbers. Decimals require the gamma function, a continuous extension that is beyond this calculator.

How big a number can it handle?

Very large ones - it uses big-integer arithmetic for exact results, and shows huge answers with a digit count and scientific notation. An upper cap keeps the page responsive.

Is the result exact?

Yes. Because it uses BigInt rather than floating point, every digit of the factorial is precise, even for results with hundreds of digits.

MB
Mustafa Bilgic · Editor, Calcool
Computes n! exactly with JavaScript BigInt arithmetic. Everything runs in your browser - nothing you enter is uploaded, logged or stored.

Related calculators