Factorial Calculator

Free online factorial calculator. Compute n! for any non-negative integer up to 170, with validation and overflow protection.

Calculator not found.

How It Works

  1. 1

    Enter a non-negative integer (0 through 170).

  2. 2

    The calculator multiplies all integers from 1 to n to produce n!.

  3. 3

    Values above 170 exceed JavaScript's numeric range and are rejected to prevent displaying Infinity.

Formula

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

Examples

Calculate 7!

7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5,040.

Calculate 0!

By definition, 0! = 1. This convention ensures combinatorial formulas work correctly for edge cases.

Frequently Asked Questions