Factorial Calculator

Find n factorial for any integer up to 20.

Result

3,628,800

How it is calculated

The factorial of a non-negative whole number is the product of all whole numbers from 1 up to it: n! = n × (n−1) × … × 2 × 1, with 0! = 1 by definition. The tool multiplies the integers one by one in exact integer arithmetic. It accepts only whole numbers from 0 to 20, because 20! = 2,432,902,008,176,640,000 is the largest factorial that fits in a 64-bit integer; a decimal, a negative number or anything above 20 returns no result rather than an inexact one. Digits are grouped with the separator of the page language.

Worked example

For n = 10 the product is 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1. Multiply in pairs: 10 × 9 = 90, 90 × 8 = 720, 720 × 7 = 5,040, 5,040 × 6 = 30,240, 30,240 × 5 = 151,200, 151,200 × 4 = 604,800, 604,800 × 3 = 1,814,400, and × 2 = 3,628,800. The tool returns 3,628,800. That is how many different orders 10 distinct items can be arranged in.

Try this example →

Common mistakes

  • Entering a decimal such as 4.5. Factorial here is defined for whole numbers only, so there is no result.
  • Expecting 0! to be 0. By definition 0! = 1, which is what makes combination formulas work.
  • Typing a number above 20 and expecting a huge value. Beyond 20 the result no longer fits exactly, so the tool refuses it.
  • Confusing n! with n × 2 or n². Factorial grows far faster: 5! = 120, while 5² = 25.
  • Using n! when order does not matter. For choosing a group from n items you need combinations, which divide factorials by each other.

About this calculator

This tool computes n! (n factorial), the product of every whole number from 1 up to n — for example 5! = 5×4×3×2×1 = 120. It is capped at 20 because 20! is the largest factorial that fits in a 64-bit integer, which keeps every result exact.

Factorials show up constantly in combinatorics: counting how many ways a deck of cards can be arranged, how many ways a race can finish, or computing permutations and combinations for probability problems. Students, and anyone writing code that needs nCr or nPr, use this to check their work by hand.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators