Toolverge

Factorial Calculator

The factorial of a non-negative integer n, written n!, is the product of every positive integer from 1 to n (with 0! defined as 1). Factorials grow extremely fast — 20! already has 19 digits — so Toolverge uses exact BigInt arithmetic instead of regular floating-point numbers, which lose precision past 2^53. The display is capped at 170! for a responsive page, though the same BigInt math supports much larger values.

5!

120

3 digits

How it works

  1. Enter a non-negative integer.
  2. The calculator multiplies 1 through n using exact BigInt math.
  3. The result and its digit count are shown; display is capped at 170! for performance.

Formula n! = n × (n-1) × (n-2) × ... × 1, with 0! = 1

Frequently asked questions

What is 5 factorial?

5! = 5 × 4 × 3 × 2 × 1 = 120.

What is 0 factorial?

0! is defined as 1 by convention.

Why use BigInt instead of a normal number?

Factorials exceed the safe integer range very quickly; BigInt keeps every digit exact instead of rounding.

Can factorial be negative?

No. Factorial is only defined for non-negative integers.

Why is the display capped at 170?

170! is roughly the largest factorial a standard double can represent; the calculator caps display there for speed, though its BigInt math itself has no such limit.