Factorial Calculator – Calculate n Factorial

Factorial Calculator

Calculate n! for non-negative integers.

Enter an integer from 0 to 170.

How Factorials Work

A factorial multiplies a whole number by every positive integer below it. It is commonly used in permutations, combinations, probability, series expansions and many counting problems.

Formula

n! = n × (n − 1) × (n − 2) × … × 2 × 1, with 0! = 1.

Worked Example

For n = 6, the factorial is 6 × 5 × 4 × 3 × 2 × 1 = 720. This means there are 720 possible ways to arrange six distinct items in order.

Factors That Affect the Result

Factorials grow extremely quickly as n increases. Input must be a non-negative integer, and browser number limits mean very large factorials cannot be represented exactly with standard JavaScript numbers.

Frequently Asked Questions

Why is 0! equal to 1?
This definition keeps combinatorial formulas consistent and represents the single way to arrange zero objects.

Can I calculate factorials of decimals?
Not with this calculator. Standard factorial notation applies to non-negative integers, although the gamma function generalizes the idea.

Where are factorials used?
They appear in probability, combinations, permutations, binomial coefficients and many areas of discrete mathematics.


Methodology, Assumptions and Interpretation

For a nonnegative integer n, n! is the product n×(n−1)…×1, with 0! defined as 1. Factorials grow extremely quickly, so large inputs can exceed ordinary numeric precision and are often represented with arbitrary-precision arithmetic or logarithms.