Skip to main content

Factorial Calculator

API reference

Calculate n! or the double factorial n!! exactly for any whole number up to 5000, with digit count, trailing zeros and scientific notation.

Input

Whole number from 0 to 5000

Output

Result
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/factorial-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "n": "10",
    "kind": "factorial"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `factorial-calculator` tool (Factorial Calculator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/factorial-calculator/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Factorial Calculator — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

What is a factorial?

The factorial of a non-negative integer n, written n!, is the product of every whole number from 1 up to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By convention 0! = 1. Factorials count the ways to arrange n distinct items and appear throughout permutations, combinations, probability and series expansions.

How this tool works

  1. Enter a whole number from 0 to 5000.
  2. Choose Factorial (n!) or Double factorial (n!!).
  3. Read the exact result, its scientific notation, the number of digits and the number of trailing zeros.

All arithmetic uses arbitrary-precision integers, so results are exact rather than rounded floating-point approximations. Very long results are shortened on screen, but Copy and Download give you the full value.

Double factorial

The double factorial n!! multiplies every second number down from n: 9!! = 9 × 7 × 5 × 3 × 1 = 945. It is not the factorial of a factorial.

Trailing zeros

Each trailing zero in n! comes from a factor pair of 2 and 5. Since 2s are plentiful, the count equals ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …; 100! ends with 24 zeros.

Privacy

Everything runs in your browser — nothing is uploaded.

n!factorialdouble factorialbig numbercombinatoricstrailing zeros

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.