Factorial Calculator

Type a whole number n to get n factorial, the product 1 × 2 × 3 × … × n, with every digit exact. It also counts the digits and the zeros at the end.

How it works

The calculator multiplies 1 × 2 × 3 and so on up to n, using exact whole-number arithmetic, so no digit is ever rounded.

It counts the digits, and the trailing zeros, which come from the factors of 5 in the numbers 1 to n. It also gives the value in scientific notation to 10 significant digits.

It accepts n from 0 to 10,000. 10,000! has 35,660 digits and takes a few hundredths of a second. Everything runs on this page.

How to use it

  1. 1 Type a whole number from 0 to 10,000.
  2. 2 Read the exact value, with every digit.
  3. 3 Read the digit count, the trailing zeros and the scientific notation below it.
  4. 4 Press Copy beside the exact value to paste it somewhere else.

Good to know

  • A normal calculator shows 171! as an error or infinity. Here it is exact.
  • For counting arrangements, n! is the number of orders n different things can go in: 52! for a shuffled deck of cards.
  • The trailing zero count is useful for puzzles: 100! ends in 24 zeros.
  • Commas in the number are ignored, so 1,000 works.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

What a factorial counts, and why it outgrows every calculator

The factorial of a whole number n, written n!, is every whole number from 1 to n multiplied together. 5! is 1 × 2 × 3 × 4 × 5, which is 120. It answers a simple question: in how many different orders can n different things be lined up? Five books on a shelf can go in 120 orders. The first place has 5 choices, the next has 4, and so on down to 1.

Factorials grow faster than powers. 10! is 3,628,800. 20! is about 2.4 quintillion, the largest factorial that fits in a 64-bit whole number. 25! is 15,511,210,043,330,985,984,000,000, which has 26 digits. A deck of 52 cards can be shuffled into 52! orders, a number with 68 digits. That is far more than the number of seconds since the universe began, so a well-shuffled deck is almost certainly in an order no deck has ever been in before.

Ordinary calculators lose this race early. They store numbers as floating point, with about 16 significant digits and a ceiling near 1.8 × 10^308. 25! comes back as 1.551121004 × 10^25, with its last 16 digits rounded away, and 171! overflows completely. This calculator multiplies in exact whole-number arithmetic instead, so 25! keeps all 26 digits and 1,000! keeps all 2,568. Every digit you copy from it is correct.

Two other figures come with the result. The digit count tells you the size at a glance. The trailing zero count answers a classic puzzle: how many zeros does 100! end in? Each zero needs a factor of 10, which is a 2 and a 5. There are always more 2s than 5s, so you count the 5s. 100 has 20 multiples of 5, and 4 of them, 25, 50, 75 and 100, bring a second 5. That makes 24 zeros, and the calculator agrees.

Some limits are worth knowing. The calculator accepts whole numbers from 0 to 10,000. Larger factorials are possible to compute but have tens of thousands of digits, take longer, and are rarely needed written out in full. It does not compute the gamma function, which extends factorials to decimals and is what a spreadsheet uses for a non-whole input. Scientific notation is rounded to 10 significant digits, but the exact value above it is never rounded.

Frequently asked questions

Why is 0! equal to 1?

There is exactly one way to arrange zero things: do nothing. The definition also keeps the rule n! = n × (n − 1)! working, since 1! = 1 × 0! needs 0! to be 1.

Why does my calculator fail above 170?

Most calculators and spreadsheets store numbers as 64-bit floating point, which tops out near 1.8 × 10^308. 170! is about 7.3 × 10^306 and fits. 171! is about 1.2 × 10^309 and does not. This tool uses exact whole-number arithmetic instead, so it has no such ceiling.

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

No. The factorial is defined for whole numbers 0 or more. The gamma function extends it to decimals, but that is a different calculation, and this tool does not do it.

Why is the limit 10,000?

Past 10,000 the answer has tens of thousands of digits and starts to take a noticeable time to build and show. 10,000! already has 35,660 digits.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.