Factorial calculator

Exact integer arithmetic — 1000! is computed in full, not approximated.

Try one
20!
19 digits

n! = 1 × 2 × … × n

2432902008176640000

Digits19
Scientific form2.432902 × 10^18
log₁₀18.3861
Natural log42.3356
Trailing zeros4
Even or oddEven
n20
Fits in a doubleYes, approximately
Moden!
n20
Digits19
Result19 digits

Factorial Calculator

Type a whole number n and get n! exactly, every digit, for any n up to 20,000: 10! is 3,628,800 and 100! is a 158-digit number. The same calculator works out permutations (nPr) and combinations (nCr), and gives digit counts, trailing zeros and scientific notation for results too long to read.

Factorials
n!
Ordered selections
nPr
Unordered selections
nCr
BigInt arithmetic
Exact

Step by step

How to use it

  1. 01

    01Choose the calculation

    Pick factorial for arrangements of all n items, permutations when order matters, or combinations when it does not.

  2. 02

    02Enter n and r

    Use non-negative integers, with r no larger than n for selections.

  3. 03

    03Read the scale

    The exact result appears with its digit count, scientific form, logarithms, parity, and trailing-zero count.

  4. 04

    04Reveal or copy the integer

    Long answers stay compact until you ask to show every digit.

Worked example

Choosing a three-person committee

Given

People
10
Seats
3
Order matters?
No

Combination

10C3 = 10! / (3! × 7!)
     = (10 × 9 × 8) / (3 × 2 × 1)
     = 120
Committees
120
Ordered lineups
720
All arrangements
3,628,800

The same ten people produce 720 ordered three-person lineups but only 120 committees, because each committee's six internal orders are the same selection.

Why this one

Factorials grow faster than intuition

Order is the deciding question

ABC and BAC are distinct permutations but the same combination. Decide that before choosing nPr or nCr.

Zero factorial is one

0! = 1 keeps counting identities consistent: there is exactly one way to arrange nothing.

Exact integers matter quickly

Even 171! exceeds ordinary floating-point range. BigInt keeps the integer exact rather than returning infinity or rounded digits.

Trailing zeros come from pairs of 2 and 5

Factorials contain many more factors of 2, so counting factors of 5 determines how many decimal zeros n! ends with.

The judgement call

Factorial, permutation, or combination?

  • Arrange every item in a sequence

    n!

    Every item is used and order distinguishes outcomes.

  • Award gold, silver, and bronze

    nPr

    The same people in different places are different results.

  • Choose three committee members

    nCr

    Only membership matters, not internal order.

  • Choose with repetition allowed

    Different formula

    These nPr and nCr modes select without replacement.

Reference

The numbers behind it

Factorial
n! = 1 × 2 × … × n
Permutation
nPr = n! / (n − r)!
Combination
nCr = n! / (r!(n − r)!)
Identity
nCr = nC(n − r)

FAQ

Questions, answered plainly

What is a factorial?

The factorial of a non-negative integer n is the product of every positive integer up to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120.

Why is 0 factorial equal to 1?

There is one empty arrangement, and defining 0! as 1 makes the factorial recurrence and combination formulas work at their boundaries.

What is the difference between nPr and nCr?

nPr counts selections where order matters; nCr counts groups where order does not. nPr is nCr multiplied by r!.

Are very large answers exact?

Yes. The calculator uses arbitrary-precision integers, so displayed digits are exact rather than floating-point approximations.

Can you take the factorial of a decimal like 5.5?

Factorial is defined for whole numbers, so this factorial calculator takes integers only. A decimal such as 5.5 has a factorial only through the gamma function, where 5.5! = Γ(6.5) ≈ 287.885.

Which number has the factorial 620448401733239439360000?

620,448,401,733,239,439,360,000 is 24 factorial (24!), a 24-digit number. Entering 24 in the factorial calculator returns it exactly, which is a quick way to check which n a large factorial came from.

What does the trailing-zero count mean?

The trailing-zero count is the number of zeros at the right end of the exact integer, determined by the number of factors of 10 in the result.

All factorial, permutation, and combination arithmetic runs in your browser. No inputs or results are sent anywhere.