Boneyard Tools

Factorial Calculator (n!)

Enter a whole number and the calculator multiplies every positive integer up to it to give n!, the factorial. It runs the multiplication with exact big-integer math, so a result with hundreds of digits stays precise instead of collapsing to scientific notation. The header also reports how many digits the answer has, and one click copies the full number even when it is far too long to read at a glance.

How to calculate a factorial

  1. Click the Number (n) field and clear the sample value.
  2. Type a non-negative whole number such as 20.
  3. Read the digit count in the header, for example '20! has 19 digits'.
  4. View the full exact result in the scrollable box below.
  5. Press Copy to place the entire number on your clipboard.

Examples

Factorial of 5

5
120 (3 digits)

Factorial of 0

0
1 (1 digit)

A larger factorial

20
2432902008176640000 (19 digits)

Frequently asked questions

What is a factorial?

The factorial of n, written n!, is the product of every positive integer from 1 up to n. For example 5! = 5 x 4 x 3 x 2 x 1 = 120, and each step just multiplies in the next number.

Why is 0! equal to 1?

0! is defined as the empty product, which is 1 by convention. That choice keeps counting formulas for permutations and combinations working without special cases, so the tool returns 1 for an input of 0.

Can it handle very large numbers?

Yes. The engine uses arbitrary-precision integer arithmetic rather than floating point, so results stay exact to the final digit even when they run to hundreds of digits, such as the 158 digit value of 100!.

Is there an upper limit on n?

The input is capped at 100000, and entering more shows a prompt to pick a number of 100000 or less. Values near that ceiling produce enormous answers and take a moment to compute and render.

Why does it show a digit count instead of just the number?

Factorials grow explosively, so the header states how many digits the result has to give you a quick sense of scale. For instance 10! is 3628800 with 7 digits, while 20! jumps to 19 digits.

Why can't I take the factorial of a negative or decimal number?

The ordinary factorial is only defined for non-negative integers, so a negative input returns an error and a decimal is rejected. Extending factorials to those values needs the gamma function, which this tool does not compute.

What are factorials actually used for?

They count arrangements: n! is the number of ways to order n distinct items. They also appear throughout probability, in combinations and permutations, and in series expansions like the one for the number e.

How can I read a result that is thousands of digits long?

The result sits in a scrollable box so it never overflows the page, and the Copy button grabs the whole value at once. From there you can paste it into a document or a math tool for further work.

Is my input private?

Yes. Every multiplication happens locally in your browser and the number you enter is never uploaded to a server.

Learn more

Related tools