Stirling's Approximation Calculator

n! ≈ √(2πn)(n/e)ⁿ

CalculatorsFreeNo Signup
4.5(58 reviews)
All Tools

Loading tool...

About Stirling's Approximation Calculator

A Stirling's approximation calculator that estimates n! ≈ √(2πn)(n/e)ⁿ. Shows the approximation, exact value (when computable), relative error, and ln(n!) for large n. Includes the extended Stirling series for higher accuracy. All calculations are client-side. Essential for statistics, physics, information theory, and combinatorics.

Stirling's Approximation Calculator Features

  • n! approx
  • Error %
  • ln(n!)
  • Extended series
  • Exact compare
Stirling's approximation: n! ≈ √(2πn)(n/e)ⁿ. For ln(n!): ln(n!) ≈ n·ln(n) − n + ½·ln(2πn). Relative error ≈ 1/(12n). Extended: n! ≈ √(2πn)(n/e)ⁿ(1 + 1/(12n) + 1/(288n²) − ...). Accuracy improves rapidly as n grows.

How to Use

Enter n:

  • Input: Positive integer
  • Output: Stirling approximation
  • Extra: Error and ln(n!)

Accuracy

  • n=1: ~8.3% error
  • n=10: ~0.83% error
  • n=100: ~0.083% error
  • n=1000: ~0.0083% error

Why Approximate?

For large n, n! overflows computers. Stirling gives a usable formula. ln(n!) avoids overflow entirely. Used in entropy formulas, statistical mechanics, and information theory.

Step-by-Step Instructions

  1. 1Enter n.
  2. 2View Stirling approximation.
  3. 3Compare with exact value.
  4. 4Check relative error.
  5. 5See ln(n!) for large n.

Stirling's Approximation Calculator — Frequently Asked Questions

How accurate is Stirling's formula?+

The relative error is approximately 1/(12n). At n=10, error is ~0.83%. At n=100, it's ~0.083%. The extended series (with correction terms) is even more accurate.

Why use ln(n!) instead of n!?+

n! grows super-exponentially and overflows for n>170 in floating point. ln(n!) grows much slower (≈ n·ln(n)) and stays computable for n in the millions.

Where is Stirling's approximation used?+

Statistical mechanics (entropy S = k·ln(W) requires ln(N!)), information theory (channel capacity), combinatorics (asymptotic counting), and physics (partition functions).

Share this tool: