All calculators

Education

Factorial Calculator

Last updated: May 31, 2026

Written by Blake Boege

A factorial calculator is a mathematical counting utility that computes the product of all positive integers less than or equal to n. It employs arbitrary-precision integer arithmetic to preserve exact digits for inputs above 20! and displays progress lists and scientific notation fallbacks.

Calculate the factorial (n!) of any whole non-negative integer up to 170 with step-by-step expansions. Employs BigInt accuracy to preserve full precision.

Quick Answer

Calculate factorials (n!) for non-negative integers up to 170. Get exact long integer values via BigInt, scientific notations, and full product expansions.

Accepts whole non-negative integers up to 170. · e.g. 5

What is a Factorial?

The factorial of a non-negative integer n is the product of all positive integers less than or equal to n.

n! = n × (n−1) × (n−2) × ... × 1

By convention, 0! = 1.

Factorial Solution

5!

120

Exact digits count: 3

Number of digits3
Exact standard form120
Scientific form120

Calculations are done with BigInt support, yielding exact values without losing precision at large inputs.

Factorial Step-by-Step Expansion

Formula:5! = 5 × 4 × 3 × 2 × 1
Result:120
Was this helpful?

Examples

Small Integer: 5!

Result = 120 (5 × 4 × 3 × 2 × 1)

Medium Integer: 10!

Result = 3,628,800

Large Integer: 20!

Result = 2.4329 × 10^18 (Exact: 2,432,902,008,176,640,000)

How it works

The calculation multiply integers consecutively down to 1:

Recurrence Relation

n! = n · (n − 1)!

Where 0! is defined as 1.

Factorials reference list (0! to 20!)

nn! Value
0!1
1!1
2!2
3!6
4!24
5!120
6!720
7!5,040
8!40,320
9!362,880
10!3,628,800
11!39,916,800
12!479,001,600
13!6,227,020,800
14!87,178,291,200
15!1,307,674,368,000
16!20,922,789,888,000
17!355,687,428,096,000
18!6,402,373,705,728,000
19!121,645,100,408,832,000
20!2,432,902,008,176,640,000

Related combinatorics calculators

Explore other counting and arrangement math calculators:

Related Calculators

More tools from Education

Frequently asked questions

A factorial is the product of all positive integers less than or equal to a given non-negative integer 'n'. It is written as 'n!' (read as 'n factorial'). For example: 5! = 5 × 4 × 3 × 2 × 1 = 120.

In mathematics, defining 0! = 1 is logical and necessary for several reasons: (1) It represents the number of ways to arrange zero items (which is exactly 1 way: empty set). (2) It keeps the combinatorics formulas, like permutations P(n, r) and combinations C(n, r), consistent without causing division-by-zero errors. (3) It fits the algebraic recurrence relation (n-1)! = n! / n (where 0! = 1! / 1 = 1).

10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 3,628,800.

In standard computer systems using 64-bit floating-point numbers (Double precision), values overflow to Infinity at 171!. By leveraging BigInt support in JavaScript, this calculator can solve exact integers for any input, but limits the UI threshold to 170! to prevent browser rendering bottlenecks.