Factorial Calculator

Calculate n! (n factorial) for values from 0 to 170. See the full multiplication breakdown.

This tool is for informational and educational purposes only. It is not a substitute for professional financial, medical, legal, or engineering advice. See Terms of Service.

Can't find what you need?

Request a Tool

How to Use the Factorial Calculator

Enter a non-negative integer and the calculator instantly computes its factorial. The result and the full multiplication steps are shown.

  1. Enter a number. Type any whole number from 0 to 170. Values above 170 exceed JavaScript's number range.
  2. Read the result. The factorial value appears along with the step-by-step multiplication. For example, 5! = 5 x 4 x 3 x 2 = 120.
  3. Copy or share. Use the buttons to grab the result or send a link.

The factorial of n (written n!) is the product of all positive integers from 1 to n. By definition, 0! = 1 and 1! = 1.

About Factorials

Factorials are fundamental in combinatorics, probability, and algebra. The number n! counts how many ways you can arrange n distinct objects in a row (permutations). It appears in the formulas for combinations (n choose k), the binomial theorem, Taylor series, and many other areas of mathematics.

Factorials grow extremely fast. 10! is 3,628,800. By 20!, the number exceeds 2 quintillion. This rapid growth is why the calculator limits input to 170, which is the largest integer whose factorial fits in a JavaScript floating-point number.

Frequently Asked Questions

What is a factorial?

A factorial (n!) is the product of all positive integers from 1 to n. For example, 5! = 5 x 4 x 3 x 2 x 1 = 120. By definition, 0! = 1.

Why is 0! equal to 1?

By convention and for mathematical consistency. There is exactly one way to arrange zero objects: do nothing. Also, the recursive definition n! = n x (n-1)! requires 0! = 1 to make 1! = 1 x 0! = 1 work correctly.

Why is the maximum input 170?

JavaScript uses 64-bit floating-point numbers, which can represent values up to about 1.8 x 10^308. 170! is approximately 7.26 x 10^306, which fits. 171! exceeds this limit and returns Infinity.