The basic factorial (n!) is the product of all positive integers less than or equal to n. For example, 5!=5×4×3×2×1=120. By convention, 0!=1. Factorials grow extremely rapidly and are fundamental in combinatorics, probability, and algebra.
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 1 to your number. Click this option and you'll see one input box asking for your number. Enter any whole number from 0 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 k 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 5—click Calculate and see 120 appear as the result because 5!=5×4×3×2×1=120.
Start with small numbers to understand the pattern. Calculate 3! and get 6 (because 3×2×1=6). Then try 4! for 24, 6! for 720, and 7! for 5040. Notice how quickly factorials grow—each new number multiplies the previous result.
Special case: Enter 0 and get 1. This isn't a mistake—by mathematical definition, 0!=1. This convention makes many formulas work correctly. Similarly, 1!=1 because there's only one number to multiply.
The calculator handles large numbers using scientific notation. Try 20! and see a result like 2.432902e+18 (meaning 2.432902×1018 or about 2.4 quintillion). For very large numbers, the calculator shows evalue 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!! by entering 8 with Double selected. The result is 384 because 8!!=8×6×4×2=384. Notice it skips all odd numbers (7,5,3,1). Each step goes down by 2 instead of 1.
For odd numbers, try 7!! and get 105 because 7!!=7×5×3×1=105. This skips all even numbers (6,4,2). The pattern depends on whether your starting number is even or odd.
Small examples: 4!!=4×2=8, 5!!=5×3×1=15, 6!!=6×4×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 (enter 3 with Subfactorial selected). The result is 2 because there are exactly 2 ways to arrange three items (A,B,C) so none stay in place: (B,C,A) and (C,A,B). Try placing each letter—neither arrangement leaves any letter in its original spot.
Try !4 and get 9. For four items, there are 9 derangements out of the 24 total arrangements (which is 4!). The subfactorial is always less than the regular factorial because it counts only specific arrangements, not all of them.
Examples: !2=1 (only one way to swap two items), !5=44, !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 1 (basic) or 2 (double), you can go down by any number k. This option requires two inputs: n (your starting number) and k (your step size).
Select Multifactorial and two boxes appear. Enter 10 in the first box and 3 in the second. Click Calculate to see 280 because 10(3)!=10×7×4×1=280. Each step subtracts 3: start at 10, then 7, then 4, then 1.
When k=1, multifactorial equals basic factorial: 5(1)!=5!=120. When k=2, it equals double factorial: 8(2)!=8!!=384. Multifactorial generalizes both of these.
Try 12 with k=4: get 12(4)!=12×8×4=384. Or 9 with k=3: get 9(3)!=9×6×3=162. Choose k based on the pattern you need—it controls which numbers get multiplied together.
Computing Primorials
Primorial (n#) multiplies only prime numbers up to n. 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# by entering 10 with Primorial selected. The result is 210 because the primes up to 10 are 2,3,5,7, and 2×3×5×7=210. The calculator automatically identifies primes and skips composite numbers like 4,6,8,9,10.
Small examples: 5#=2×3×5=30, 7#=2×3×5×7=210, 11#=2×3×5×7×11=2310. Notice 7# and 10# are the same because there are no primes between 7 and 10.
If you enter a prime number itself, it includes that prime. Try 13# and get 30030 because it multiplies all primes up to and including 13: 2×3×5×7×11×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 1. The symbol is an exclamation mark: n! means "multiply n by all smaller positive integers."
For example, 4! means 4×3×2×1=24. You start at 4, multiply by 3 to get 12, multiply by 2 to get 24, multiply by 1 (which doesn't change anything) to get 24. Every step multiplies by the next smaller number.
Factorials count how many ways you can arrange things. If you have 4 books, there are 4!=24 different ways to order them on a shelf. First book has 4 choices, second has 3 remaining choices, third has 2, last has 1—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!=1, 2!=2, 3!=6, 4!=24, 5!=120, 6!=720, 7!=5040. Each new factorial multiplies the previous one by the next number. Going from 6! to 7! means multiplying 720 by 7.
By 10! you reach 3,628,800—over three million. By 15! you're at 1,307,674,368,000—over a trillion. By 20! you hit 2,432,902,008,176,640,000—that's 2.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+18, that's 1.234×1018 or 1.234 followed by 18 more digits. For very large factorials (like 100!), the calculator shows enumber format instead.
Practical limit: Most real-world factorial problems use numbers under 20. Calculating 70! gives a number with over 100 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!=120, you know 6!=120×6=720. And 7!=720×7=5040. Each factorial builds on the previous one.
Dividing factorials: When you divide factorials, numbers cancel. 3!5!=3×2×15×4×3×2×1=5×4=20. The 3! cancels out, leaving only the top numbers. This simplifies many calculations.
Factorials in fractions: The expression (n−2)!n! equals n×(n−1). Try with 5: 3!5!=6120=20=5×4. This pattern appears in permutation formulas.
Zero factorial rule: Remember 0!=1, not 0. This makes formulas work: the binomial coefficient (0n)=0!×n!n!=1×n!n!=1. If 0! were 0, you'd divide by zero and the formula would break.
Practice Problems to Try
Basic factorials: Calculate 3!, 6!, and 9!. Answers: 6 (because 3×2×1=6), 720, and 362,880. Verify each by multiplying all numbers from your starting point down to 1.
Zero and one: Find 0! and 1!. Both equal 1. Remember this special case—it's used constantly in formulas and calculations.
Double factorials: Compute 6!! and 9!!. Answers: 48 (because 6×4×2=48) and 945 (because 9×7×5×3×1=945). Even numbers give smaller results than odd numbers at the same starting point.
Subfactorials: Find !4 and !5. Answers: 9 and 44. These count derangements—arrangements where nothing stays in place.
Primorials: Calculate 12# and 15#. Answers: 2310 (multiply primes 2,3,5,7,11) and 30030 (multiply primes 2,3,5,7,11,13). List the primes first, then multiply.
Multifactorial: Compute 15(5)! (step by 5). Answer: 15×10×5=750.
Where Factorials Are Used
Counting arrangements: If you have 5 different books, there are 5!=120 ways to arrange them on a shelf. First position has 5 choices, second has 4 remaining, third has 3, fourth has 2, last has 1. Multiply: 5×4×3×2×1=120.
Probability calculations: Drawing cards, rolling dice, or picking lottery numbers all use factorials. The number of ways to choose 3 items from 10 is 3!×7!10!=120. This formula appears everywhere in probability.
Password combinations: A 4-digit PIN where no digit repeats has 10×9×8×7=5040 possibilities—that's 6!10!. Security systems use factorial calculations to measure password strength.
Tournament scheduling: Arranging 8 teams in a bracket uses factorial math. The number of possible matchup orders is related to 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 ex can be written as 1+x+2!x2+3!x3+...
Related Calculators and Concepts
Combination Calculator uses factorials to count selections. The formula for choosing r items from n is r!(n−r)!n!. 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−r)!n! counts ways to arrange r items from n total items.
Binomial Coefficient (written (kn)) equals k!(n−k)!n! 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)=(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.