Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

Factorial Calculator


?How to use Factorial Calculator+
  • Select the type of factorial you want to calculate (Basic, Double, Subfactorial, Multifactorial, or Primorial)
  • Enter your number n in the first input field
  • For Multifactorial, also enter the step value k in the second field
  • Click Calculate to see the result
  • Hover over ? icons for additional help
?
=

The basic factorial (n!n!) is the product of all positive integers less than or equal to nn. For example, 5!=5×4×3×2×1=1205! = 5 \times 4 \times 3 \times 2 \times 1 = 120. By convention, 0!=10! = 1. Factorials grow extremely rapidly and are fundamental in combinatorics, probability, and algebra.









Getting Started with the Calculator

The factorial calculator offers five different types at the top: Basic (n!), Double (n!!), Subfactorial (!n), Multifactorial (n(k)!), and Primorial (n#). Start by clicking one of these radio buttons to select which type you want to calculate.

For most calculations, you'll use Basic (n!)—the standard factorial that multiplies all numbers from 11 to your number. Click this option and you'll see one input box asking for your number. Enter any whole number from 00 upward.

The other types are specialized: Double for even/odd sequences, Subfactorial for counting arrangements, Multifactorial for custom step sizes (requires two inputs), and Primorial for prime number products. Select the type that matches your problem.

After entering your number (and kk value for multifactorial), click the blue Calculate button. Your result appears on the right side of the equals sign. Use Reset to clear everything and start over.

Using Basic Factorial

Basic (n!) is the most common type. Select this radio button at the top, then enter a whole number in the box. Try 55—click Calculate and see 120120 appear as the result because 5!=5×4×3×2×1=1205! = 5 \times 4 \times 3 \times 2 \times 1 = 120.

Start with small numbers to understand the pattern. Calculate 3!3! and get 66 (because 3×2×1=63 \times 2 \times 1 = 6). Then try 4!4! for 2424, 6!6! for 720720, and 7!7! for 50405040. Notice how quickly factorials grow—each new number multiplies the previous result.

Special case: Enter 00 and get 11. This isn't a mistake—by mathematical definition, 0!=10! = 1. This convention makes many formulas work correctly. Similarly, 1!=11! = 1 because there's only one number to multiply.

The calculator handles large numbers using scientific notation. Try 20!20! and see a result like 2.432902e+182.432902e+18 (meaning 2.432902×10182.432902 \times 10^{18} or about 2.42.4 quintillion). For very large numbers, the calculator shows evaluee^{\text{value}} format to represent the enormous result.

Calculating Double Factorials

Select Double (n!!) when you need to multiply only even numbers or only odd numbers. This type skips every other number. For even inputs, it multiplies all even numbers; for odd inputs, it multiplies all odd numbers.

Try 8!!8!! by entering 88 with Double selected. The result is 384384 because 8!!=8×6×4×2=3848!! = 8 \times 6 \times 4 \times 2 = 384. Notice it skips all odd numbers (7,5,3,17, 5, 3, 1). Each step goes down by 22 instead of 11.

For odd numbers, try 7!!7!! and get 105105 because 7!!=7×5×3×1=1057!! = 7 \times 5 \times 3 \times 1 = 105. This skips all even numbers (6,4,26, 4, 2). The pattern depends on whether your starting number is even or odd.

Small examples: 4!!=4×2=84!! = 4 \times 2 = 8, 5!!=5×3×1=155!! = 5 \times 3 \times 1 = 15, 6!!=6×4×2=486!! = 6 \times 4 \times 2 = 48. Double factorials appear in physics formulas, probability calculations, and certain mathematical sequences.

Working with Subfactorials

Subfactorial (!n) counts arrangements where nothing stays in its original position—called derangements. Select this type and enter a number to see how many ways you can rearrange items so each one moves.

Start with !3!3 (enter 33 with Subfactorial selected). The result is 22 because there are exactly 22 ways to arrange three items (A,B,C)(A, B, C) so none stay in place: (B,C,A)(B, C, A) and (C,A,B)(C, A, B). Try placing each letter—neither arrangement leaves any letter in its original spot.

Try !4!4 and get 99. For four items, there are 99 derangements out of the 2424 total arrangements (which is 4!4!). The subfactorial is always less than the regular factorial because it counts only specific arrangements, not all of them.

Examples: !2=1!2 = 1 (only one way to swap two items), !5=44!5 = 44, !6=265!6 = 265. Subfactorials are used in probability (like the "hat check problem") and combinatorics when calculating arrangements with restrictions.

Understanding Multifactorial

Multifactorial (n(k)!) lets you choose your step size. Instead of going down by 11 (basic) or 22 (double), you can go down by any number kk. This option requires two inputs: nn (your starting number) and kk (your step size).

Select Multifactorial and two boxes appear. Enter 1010 in the first box and 33 in the second. Click Calculate to see 280280 because 10(3)!=10×7×4×1=28010(3)! = 10 \times 7 \times 4 \times 1 = 280. Each step subtracts 33: start at 1010, then 77, then 44, then 11.

When k=1k=1, multifactorial equals basic factorial: 5(1)!=5!=1205(1)! = 5! = 120. When k=2k=2, it equals double factorial: 8(2)!=8!!=3848(2)! = 8!! = 384. Multifactorial generalizes both of these.

Try 1212 with k=4k=4: get 12(4)!=12×8×4=38412(4)! = 12 \times 8 \times 4 = 384. Or 99 with k=3k=3: get 9(3)!=9×6×3=1629(3)! = 9 \times 6 \times 3 = 162. Choose kk based on the pattern you need—it controls which numbers get multiplied together.

Computing Primorials

Primorial (n#) multiplies only prime numbers up to nn. Select this type and enter a number—the calculator finds all primes less than or equal to your number and multiplies them together.

Try 10#10\# by entering 1010 with Primorial selected. The result is 210210 because the primes up to 1010 are 2,3,5,72, 3, 5, 7, and 2×3×5×7=2102 \times 3 \times 5 \times 7 = 210. The calculator automatically identifies primes and skips composite numbers like 4,6,8,9,104, 6, 8, 9, 10.

Small examples: 5#=2×3×5=305\# = 2 \times 3 \times 5 = 30, 7#=2×3×5×7=2107\# = 2 \times 3 \times 5 \times 7 = 210, 11#=2×3×5×7×11=231011\# = 2 \times 3 \times 5 \times 7 \times 11 = 2310. Notice 7#7\# and 10#10\# are the same because there are no primes between 77 and 1010.

If you enter a prime number itself, it includes that prime. Try 13#13\# and get 3003030030 because it multiplies all primes up to and including 1313: 2×3×5×7×11×13=300302 \times 3 \times 5 \times 7 \times 11 \times 13 = 30030. Primorials are used in number theory and studying prime distributions.

What Are Factorials

A factorial takes a number and multiplies it by every positive whole number below it, all the way down to 11. The symbol is an exclamation mark: n!n! means "multiply nn by all smaller positive integers."

For example, 4!4! means 4×3×2×1=244 \times 3 \times 2 \times 1 = 24. You start at 44, multiply by 33 to get 1212, multiply by 22 to get 2424, multiply by 11 (which doesn't change anything) to get 2424. Every step multiplies by the next smaller number.

Factorials count how many ways you can arrange things. If you have 44 books, there are 4!=244! = 24 different ways to order them on a shelf. First book has 44 choices, second has 33 remaining choices, third has 22, last has 11—multiply these together.

Why does 0! equal 1? By definition, there's exactly one way to arrange zero items: do nothing. This might seem strange, but it makes mathematical formulas work correctly. Think of it as the "empty arrangement"—there's one way to arrange nothing.

How Factorials Grow

Factorials get big extremely fast. Look at this pattern: 1!=11! = 1, 2!=22! = 2, 3!=63! = 6, 4!=244! = 24, 5!=1205! = 120, 6!=7206! = 720, 7!=50407! = 5040. Each new factorial multiplies the previous one by the next number. Going from 6!6! to 7!7! means multiplying 720720 by 77.

By 10!10! you reach 3,628,8003,628,800—over three million. By 15!15! you're at 1,307,674,368,0001,307,674,368,000—over a trillion. By 20!20! you hit 2,432,902,008,176,640,0002,432,902,008,176,640,000—that's 2.42.4 quintillion. The numbers become so large that writing them fully is impractical.

This rapid growth is why the calculator uses scientific notation for large results. When you see 1.234e+181.234e+18, that's 1.234×10181.234 \times 10^{18} or 1.2341.234 followed by 1818 more digits. For very large factorials (like 100!100!), the calculator shows enumbere^{\text{number}} format instead.

Practical limit: Most real-world factorial problems use numbers under 2020. Calculating 70!70! gives a number with over 100100 digits. Only specialized applications (like cryptography or advanced statistics) work with such enormous factorials.

Simple Factorial Patterns

Multiplying factorials: To go from one factorial to the next, just multiply by the next number. Since 5!=1205! = 120, you know 6!=120×6=7206! = 120 \times 6 = 720. And 7!=720×7=50407! = 720 \times 7 = 5040. Each factorial builds on the previous one.

Dividing factorials: When you divide factorials, numbers cancel. 5!3!=5×4×3×2×13×2×1=5×4=20\frac{5!}{3!} = \frac{5 \times 4 \times 3 \times 2 \times 1}{3 \times 2 \times 1} = 5 \times 4 = 20. The 3!3! cancels out, leaving only the top numbers. This simplifies many calculations.

Factorials in fractions: The expression n!(n2)!\frac{n!}{(n-2)!} equals n×(n1)n \times (n-1). Try with 55: 5!3!=1206=20=5×4\frac{5!}{3!} = \frac{120}{6} = 20 = 5 \times 4. This pattern appears in permutation formulas.

Zero factorial rule: Remember 0!=10! = 1, not 00. This makes formulas work: the binomial coefficient (n0)=n!0!×n!=n!1×n!=1\binom{n}{0} = \frac{n!}{0! \times n!} = \frac{n!}{1 \times n!} = 1. If 0!0! were 00, you'd divide by zero and the formula would break.

Practice Problems to Try

Basic factorials: Calculate 3!3!, 6!6!, and 9!9!. Answers: 66 (because 3×2×1=63 \times 2 \times 1 = 6), 720720, and 362,880362,880. Verify each by multiplying all numbers from your starting point down to 11.

Zero and one: Find 0!0! and 1!1!. Both equal 11. Remember this special case—it's used constantly in formulas and calculations.

Double factorials: Compute 6!!6!! and 9!!9!!. Answers: 4848 (because 6×4×2=486 \times 4 \times 2 = 48) and 945945 (because 9×7×5×3×1=9459 \times 7 \times 5 \times 3 \times 1 = 945). Even numbers give smaller results than odd numbers at the same starting point.

Subfactorials: Find !4!4 and !5!5. Answers: 99 and 4444. These count derangements—arrangements where nothing stays in place.

Primorials: Calculate 12#12\# and 15#15\#. Answers: 23102310 (multiply primes 2,3,5,7,112, 3, 5, 7, 11) and 3003030030 (multiply primes 2,3,5,7,11,132, 3, 5, 7, 11, 13). List the primes first, then multiply.

Multifactorial: Compute 15(5)!15(5)! (step by 55). Answer: 15×10×5=75015 \times 10 \times 5 = 750.

Where Factorials Are Used

Counting arrangements: If you have 55 different books, there are 5!=1205! = 120 ways to arrange them on a shelf. First position has 55 choices, second has 44 remaining, third has 33, fourth has 22, last has 11. Multiply: 5×4×3×2×1=1205 \times 4 \times 3 \times 2 \times 1 = 120.

Probability calculations: Drawing cards, rolling dice, or picking lottery numbers all use factorials. The number of ways to choose 33 items from 1010 is 10!3!×7!=120\frac{10!}{3! \times 7!} = 120. This formula appears everywhere in probability.

Password combinations: A 44-digit PIN where no digit repeats has 10×9×8×7=504010 \times 9 \times 8 \times 7 = 5040 possibilities—that's 10!6!\frac{10!}{6!}. Security systems use factorial calculations to measure password strength.

Tournament scheduling: Arranging 88 teams in a bracket uses factorial math. The number of possible matchup orders is related to 8!8!, though the actual formula is more complex. Sports schedulers use these calculations.

Scientific formulas: Factorials appear in Taylor series (calculus), Stirling's approximation (statistics), and binomial expansions (algebra). The function exe^x can be written as 1+x+x22!+x33!+...1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + ...

Related Calculators and Concepts

Combination Calculator uses factorials to count selections. The formula for choosing rr items from nn is n!r!(nr)!\frac{n!}{r!(n-r)!}. This calculator helps you compute combinations without calculating each factorial separately.

Permutation Calculator also uses factorials for counting arrangements where order matters. The formula n!(nr)!\frac{n!}{(n-r)!} counts ways to arrange rr items from nn total items.

Binomial Coefficient (written (nk)\binom{n}{k}) equals n!k!(nk)!\frac{n!}{k!(n-k)!} and appears in probability, Pascal's triangle, and the binomial theorem. Understanding factorials is essential for working with binomial coefficients.

Gamma Function extends factorials to non-integer values. While regular factorials only work for whole numbers, the gamma function Γ(n)=(n1)!\Gamma(n) = (n-1)! works for any number. This appears in advanced calculus and statistics.

For deeper learning, explore permutations and combinations, probability theory, binomial theorem, and how factorials appear in mathematical series and approximations.