Factorial Calculator
Compute n! exactly for any non-negative integer - no rounding, no overflow. See the full digit count for huge results and the expanded product for small n.
- Free, no account
- No watermark
- No usage limit
About the Factorial Calculator
Type a whole number, get its factorial back with every digit intact. That sounds basic until you try it on your phone. Ask a phone, a browser, or a spreadsheet for 20! and it says 2.43290200817664e18, which looks authoritative but is wrong, it rounded off the tail and the real answer keeps going a few digits past what it bothered to show. Here you get every one of those digits, so 20! comes back as the full 2,432,902,008,176,640,000, and 100! comes back with all 158 of its digits instead of a scientific-notation stand-in. It multiplies your number by every whole number below it down to 1 and hands you the complete integer, grouped in threes so a giant result is still readable. Everything runs in your browser, nothing you type leaves your machine, and after the first load it keeps working with no connection.
How to use
- Type any whole number into the box, zero or anything above it. The result updates live as you type, so a valid number shows its factorial the moment it lands. Type a decimal or a negative and you get a plain note back, not a bogus answer.
- Read the full result underneath, every digit, grouped in threes so a long number stays legible. For an ordinary-sized answer that is the whole thing spelled out.
- Once a result runs past a thousand digits the tool switches to a summary: how many digits it has, a short scientific-notation reading, and the first twenty digits, because dumping forty thousand digits on the page helps nobody.
100!still prints all 158 in full. - On small numbers, from 2 up to 12, a dashed box writes out the chain,
5! = 5 · 4 · 3 · 2 · 1 = 120, so you can see exactly where the answer came from instead of taking it on faith. - Tap a preset in the Try row to watch it run,
0!through20!, plus52!and100!. The52!one is the good one, it is how many distinct ways a single deck of cards can be shuffled, a 68-digit number.
The input caps at 10,000, and that is a courtesy to your browser rather than a math limit. 10000! already runs past 35,000 digits, and letting someone paste a million would lock the tab building a number no one could read. Ten thousand covers anything you would realistically hit.
Why big factorials come back wrong elsewhere
Factorials get huge fast, and that speed is exactly what breaks an ordinary calculator. 13! is already past six billion, 21! runs to twenty digits. The trouble is that the floating-point math inside almost every calculator, phone, browser, or spreadsheet only holds about 15 or 16 significant digits before it starts rounding. So the instant a factorial crosses that line, and it crosses early, the tool stops giving you the true value and starts handing back a rounded approximation shown in scientific notation. 21! shows up as roughly 5.109094217e19, close enough to look right and wrong in every digit past the tenth.
For a lot of what people actually use factorials for, those dropped digits are the whole answer. If you are checking a combinatorics count against a textbook, or a grader wants the exact integer on a homework problem, an answer that has the right first few digits and rounds off the rest is still wrong. And because it looks right, you might not catch that it isn't.
This tool keeps every digit because it does the multiplication with big-integer arithmetic, the kind with no size ceiling. It grows the number to whatever length the answer needs, and it never rounds along the way. 100! comes back as the complete 158-digit integer with every digit correct, and 52! gives you all 68 digits of the deck-shuffle number rather than a rounded stand-in. The free calculators stop being exact the moment a factorial gets interesting, and this one just keeps handing you the real thing.
Why 0! equals 1
Type 0 and the tool answers 1, and a fair number of people stop and squint at that. You multiplied nothing and got one instead of zero? It looks like a mistake, but it isn't one.
The clearest way to see it is to count the factorials downward. Stepping from any n! down to (n-1)! just means dividing by n. So 4! = 24, then 3! = 24 / 4 = 6, then 2! = 6 / 3 = 2, then 1! = 2 / 2 = 1. Run the same rule one more notch and 0! = 1! / 1 = 1. Nobody bolted a special case onto zero to keep things tidy, one is simply the value that stops the pattern from breaking.
There is a second reason, and it is the practical one. Combinations and permutations are built by dividing factorials by other factorials, and plenty of those formulas end up dividing by 0!. If 0! were zero you would be dividing by zero all over combinatorics, and those formulas would simply stop working. Defining it as one is what keeps everything downstream working, which is a decent sign the answer is real and not just convenient.
Frequently asked questions
Does `5! + 1` mean 121 or 720?
It means 121. The ! is the factorial symbol, read "five factorial," and it binds only to the number directly in front of it. So 5! + 1 is 120 + 1 = 121, not (5 + 1)! = 720. Whenever a factorial shares a line with other operations the parentheses decide everything. In this tool you just type the number itself, the ! is already understood.
Can I calculate the factorial of a decimal like 3.5?
Not here. This tool does exact whole-number factorials only. Factorials of non-integers are defined through the gamma function, which uses an integral instead of a running product and needs numerical approximation, so 3.5! works out to about 11.63, sitting between 3! = 6 and 4! = 24. Type a decimal into the box and you get a note pointing you at that rather than a fake-exact answer.
How many zeros does a big factorial end in?
More than you would guess, and there is a shortcut. A trailing zero comes from a factor of ten, which is a five paired with a two, and factorials always have twos to spare, so the number of trailing zeros is just the number of fives in the product. 100! picks up a five from each multiple of five (twenty of them) plus an extra from each multiple of 25 (four more), landing on exactly 24 zeros, while 1000! ends in 249 of them. It is a quick way to sanity-check a giant result without reading all the digits.
What is a double factorial (`n!!`) and is it the same thing?
No, and they get mixed up constantly. A double factorial n!! multiplies every other number down from n, not every one. So 7!! = 7 × 5 × 3 × 1 = 105, skipping the evens. It is also not (7!)!, which would be astronomically larger. This tool computes the ordinary single factorial, so if you meant the every-other-number version you want a dedicated double-factorial tool instead.
What is the largest factorial that fits in a normal computer number?
12! is the largest that fits in a signed 32-bit integer. Move up to signed 64-bit and you get as far as 20!. Past 20! an ordinary integer overflows and a floating-point number starts rounding, which is exactly where the everyday tools and this one part ways, since this calculator keeps going with big-integer math that has no ceiling.
What if I need a factorial bigger than 10,000?
Then you are into serious arbitrary-precision territory, and a computer-algebra system is the right home for it. Python's math.factorial, SymPy, or Wolfram Alpha will grind out numbers with millions of digits given the time and memory. The 10,000 cap here is about keeping a browser tab responsive, not about the math, and it comfortably covers homework, combinatorics, and any interview-style problem you are likely to meet.
Is anything I type sent to a server?
No. Every calculation runs on your own device, and nothing you enter is uploaded, logged, or tracked. Once the page has loaded a single time it keeps working with the connection off entirely.