Calculate factorial

Multiply every positive integer through a non-negative input and return its factorial.

freeworks offlinenothing uploaded
ToolFactorial Calculator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The factorial multiplies integers from one through n, with 0! defined as 1. JavaScript numbers are used and the input is capped before the result becomes non-finite.

  • 170 is the largest supported input.
  • Non-negative integers are required.

Worked example

Factorial of 10
Calculate 10 factorial
Input
											10
										
Output
												10! = 3628800
											

When to use this

Permutations use factorials, probability formulas use n!, and combinatorics lessons check the zero base case.

Edge cases

  • 0! equals 1 rather than zero.
  • Negative integers are rejected instead of extended through gamma.
  • 171! exceeds finite JavaScript-number range.