Skip to main content
Factorial / Big Numbers

Factorial Calculator

Calculate factorials of large numbers, permutations, and combinations with exact results.

0170

Computes n! exactly using BigInt arithmetic

Quick Reference

10! =
3,628,800
Number of Digits
7
Input n
10

How It Works

This big number calculator computes the factorial of an integer (written n!) using arbitrary-precision arithmetic, so it returns the complete, exact answer rather than a rounded approximation. Ordinary calculators and most programming languages store numbers as 64-bit floating-point values, which can only hold about 15โ€“17 significant digits and overflow to infinity above roughly 1.8 ร— 10ยณโฐโธ. Factorials blow past that limit almost immediately โ€” that is exactly the situation arbitrary-precision arithmetic is built for. Under the hood this tool uses JavaScript's native BigInt type, which represents whole numbers with as many digits as memory allows, so every digit of the result is correct.

It is aimed at students learning permutations and combinations, teachers preparing examples, competitive-programming and JEE/CBSE candidates checking their work, and anyone curious about just how fast factorial growth really is. Factorials grow astonishingly fast โ€” 13! already exceeds six billion, 20! is over 2 quintillion (2,432,902,008,176,640,000), and 100! is a 158-digit number. To keep the page responsive the calculator accepts inputs from 0 up to 170, returning the full exact integer for every value in that range.

What is a Factorial?

The factorial of a non-negative integer n is the product of every whole number from 1 up to n:

n! = n ร— (nโˆ’1) ร— (nโˆ’2) ร— โ€ฆ ร— 2 ร— 1

By definition 0! = 1 (the empty product). The function also satisfies the neat recursive rule n! = n ร— (nโˆ’1)!, which is why 5! = 5 ร— 4! and so on. Factorials count the number of distinct ways to arrange n different objects in a row, and they appear throughout mathematics: in permutations and combinations, in the binomial theorem, in the Taylor and Maclaurin series of functions such as eหฃ, sin x and cos x, in probability distributions, and as the integer values of the gamma function, ฮ“(n+1) = n!.

Why Floating-Point Numbers Are Not Enough

A standard double-precision float can represent 170! โ‰ˆ 7.26 ร— 10ยณโฐโถ as an approximation, but every digit beyond the seventeenth is already lost, and 171! โ‰ˆ 1.24 ร— 10ยณโฐโน overflows to Infinity entirely. Arbitrary-precision arithmetic sidesteps both problems by storing the number as a sequence of digit-groups and multiplying them the long way, exactly as you would on paper. The trade-off is speed and memory: bigger numbers take longer and use more space, which is the practical reason the input here is capped at 170.

Stirling's Approximation

When you only need the size of a factorial rather than every digit, Stirling's approximation is the standard tool:

ln(n!) โ‰ˆ nยทln(n) โˆ’ n + ยฝยทln(2ฯ€n)

Converting to base-10 logarithms lets you estimate both the number of digits and the leading figures in scientific notation without computing the full value, which is how this calculator shows large results like 50! in the form a ร— 10แต‡ alongside its exact digit count.

Worked Example

Take 5!. Multiply step by step: 5 ร— 4 = 20, then 20 ร— 3 = 60, then 60 ร— 2 = 120, and finally 120 ร— 1 = 120. So 5! = 120, meaning there are 120 different ways to order 5 distinct items. Building on that, 6! = 6 ร— 5! = 6 ร— 120 = 720, which shows the recursive shortcut in action.

Tips and Common Mistakes

Factorials are only defined for non-negative integers, so decimals and negative numbers have no ordinary factorial (those cases belong to the gamma function). A very common slip is assuming 0! = 0; it is actually 1, a convention that keeps the combination formula and the recursive rule consistent. Do not confuse n! with simple exponentials such as nโฟ or 2โฟ โ€” factorials grow far faster than any fixed-base exponential. Finally, when a result is reported in scientific notation, remember it is a rounded summary for readability; the exact integer (and its digit count) is shown separately so you always have the precise value.

Frequently Asked Questions

By convention (and combinatorial logic): there is exactly one way to arrange zero objects โ€” do nothing. The empty product equals 1. This also makes the combination formula C(n,0) = 1 work correctly. Mathematically, it preserves the recursive property n! = n ร— (nโˆ’1)!

Part of Algebra & Numbers Calculators โ€” compare every related calculator in one place.