Factorial Calculator

Factorial Calculator

Compute n! with exact integer arithmetic, live validation, and a readable summary for large outputs.

Last updated: June 2026 | By Patchworkr Team

Exact Factorial
Enter a whole number from 0 through 170. The calculator uses exact integer multiplication, so the value is not rounded during the computation.
Result
Exact value
120
Digits
3
Scientific
1.200000 x 10^2
The exact result is short enough to read directly.

What is a factorial?

n! means 1 x 2 x 3 x ... x n. By convention, 0! is defined as 1 so combinatorial formulas stay consistent.

Why the range stops at 170

The calculator can compute exact values through 170!, which still fits within finite JavaScript number limits for display and safely within BigInt for arithmetic.

Formula and example

n! = n x (n - 1) x (n - 2) x ... x 1

Example: 5! = 5 x 4 x 3 x 2 x 1 = 120.

Worked Example

Calculate 4!

1. Start with 4.

2. Multiply 4 x 3 x 2 x 1.

3. Evaluate step by step to get 24.

Final answer: 24

Frequently Asked Questions

Why is 0! equal to 1?

It keeps combinatorial identities consistent and represents the single way to arrange zero objects.

Why not allow larger inputs?

170! is the last factorial that stays finite in JavaScript number display. Larger values quickly become unwieldy.

Can factorials be negative?

Not in this calculator. Factorials are defined here only for non-negative integers.

Does this use exact arithmetic?

Yes. The factorial is computed with BigInt so the result is exact, not rounded.

Related Tools