Factorial Calculator

Quick Overview

  • This tool calculates the factorial of any non-negative integer (n!) and displays every multiplication step in sequence.
  • The factorial formula is defined as n! = n × (n−1) × (n−2) × … × 1, with the special cases 0! = 1 and 1! = 1.
  • For example, 5! = 120 and 10! = 3,628,800.
  • The calculator is designed for students solving permutation and combination problems, and for developers validating recursive functions.

Factorial Calculator: Instant n! Results with Step-by-Step Solutions

Whether you're cramming for the SAT, debugging a recursive function, or working through a probability problem set, computing large factorials by hand is slow and error-prone. The Factorial Calculator takes your input and returns the exact value of n! alongside every multiplication step.

Formula: n! = n × (n−1) × … × 1.

Purpose: solving permutation, combination, and probability problems in seconds.

What Is a Factorial?

A factorial is the product of all positive integers from 1 up to a given number n, written as n!. Two special cases are universally accepted: 0! = 1 and 1! = 1. These aren't arbitrary rules — they ensure that combination and permutation formulas work consistently across all valid inputs. In the United States, factorials appear on the SAT, ACT, AP Statistics, and AP Computer Science exams, making them a high-priority topic for students in junior and senior year. For software engineers, factorials underpin algorithms that calculate arrangements in everything from route optimization to game-state analysis. The numbers grow extraordinarily fast: while 5! is a manageable 120, 20! already exceeds two quintillion, making a calculator indispensable for anything beyond the simplest cases.

Formula and Calculation Reference

There is exactly one formula for factorial, and it applies to every non-negative integer. The table below covers the most commonly needed values along with their typical applications.

n

Calculation

Result (n!)

Common Use Case

0

By definition

1

Base case in combinations

1

1

1

Identity case

5

5 × 4 × 3 × 2 × 1

120

SAT permutation problems

10

10 × 9 × … × 1

3,628,800

Probability and statistics

13

13 × 12 × … × 1

6,227,020,800

Card game arrangements (52-card deck subsets)

20

20 × 19 × … × 1

2,432,902,008,176,640,000

Large combinatorics, algorithm analysis

Quick Examples:

How many ways can 6 NFL draft picks be ranked? 6! = 720

Choose 3 players from a 10-person roster (order matters): P(10,3) = 10!/7! = 720

Ways to arrange all 8 letters of "ABCDEFGH": 8! = 40,320

Practical Examples

SAT/ACT Counting Problems

A classic standardized-test question asks: "In how many ways can 7 students be seated in a row?" The answer is 7! = 5,040. Students who understand this formula intuitively — not just by memorization — can solve variations involving restrictions or repetitions. The step-by-step display reinforces exactly why each multiplication step is necessary.

AP Computer Science: Recursive Function Verification

A student writing a recursive factorial function in Java or Python needs a reference value to confirm their output is correct. Entering 12 returns 12! = 479,001,600 instantly. Comparing this against their program's output reveals off-by-one errors or missing base cases before submission.

Poker and Card Game Probability

Calculating the number of 5-card hands from a standard 52-card deck uses C(52,5) = 52!/(5! × 47!). Rather than computing 52! in full, understanding how the cancellation works becomes clearer when you see 5! = 120 and 47! side by side in the steps panel.

NASA-Style Route Optimization (Intro Level)

Scheduling 8 satellite passes in optimal order involves evaluating up to 8! = 40,320 possible sequences — a classic traveling salesman setup. Even at the introductory computer-science level, this example demonstrates why brute-force approaches become impractical fast and why efficient algorithms matter.

Who Can Use This Calculator?

  • High school students — Prepare for SAT, ACT, and AP exams involving permutations and combinations with instant answer verification.

  • College math and statistics students — Quickly confirm n! values for discrete math, probability theory, and combinatorics coursework.

  • Software engineers and developers — Validate recursive algorithms, dynamic programming solutions, and Big-O complexity estimates.

  • Data scientists — Compute factorials needed for Bayesian probability, permutation tests, and feature selection counts.

  • Math teachers and tutors — Demonstrate factorial growth visually for students who struggle to grasp how quickly n! scales.

  • Game developers — Calculate total possible game states and board arrangements for puzzle design and AI difficulty tuning.

  • Curious learners — Explore how many ways you can arrange your Spotify playlist or sort a deck of cards.

  • Cryptography enthusiasts — Estimate key-space sizes based on permutation counts for educational security analysis.

Conclusion and Next Steps

Factorial calculation sits at the heart of combinatorics, probability, and algorithm design. Whether you need a quick answer for a homework problem or a precise reference value for a software project, doing it by hand for anything above n = 10 invites errors. This calculator delivers the exact result alongside every step, so you understand the process rather than just copying a number. When you're ready to go further, explore the Permutation Calculator, the Combination Calculator, and the Probability Calculator to apply these values directly to your problems.

Key Takeaways

0! = 1 and 1! = 1 are mathematical definitions, not calculated results.

Factorial is only defined for non-negative integers; negative and fractional inputs are not valid.

The value of n! grows extraordinarily fast — 20! already exceeds two quintillion.

Permutations use P(n,r) = n!/(n−r)! and combinations use C(n,r) = n!/(r!×(n−r)!), both built directly on factorials.

This tool is free, works on mobile, and requires no account or sign-up.

How to Use

1
Enter the number you want to calculate
Type any non-negative integer into the input field. For example, enter 9 to calculate 9!.
2
Perform the calculation
After you enter the number, the calculation is done automatically. The process takes place instantly.
3
Check out the step-by-step breakdown
The solution panel shows each multiplication in order – for example, 9 × 8 × 7 × … × 1 – so you can follow the entire calculation.
4
Read the final factorial result
The exact value of n! is clearly displayed below the steps. Copy it directly into your assignment, code, or formula.
5
Repeat for additional values
Clear the field, enter a new number, and calculate again. When solving permutations or combinations, calculate each factorial you need individually and then apply your formula.

Frequently Asked Questions

A factorial is the product of all positive integers from 1 up to n, written as n!. For example, 6! = 6 × 5 × 4 × 3 × 2 × 1 = 720. The special cases 0! = 1 and 1! = 1 are accepted by definition. This calculator handles all non-negative integers and shows every multiplication step, so you can follow along rather than just reading a final number.
1 is a mathematical convention that keeps formulas consistent. Combinatorially, it represents the single way to arrange zero objects — doing nothing. Without this definition, formulas like C(n,0) = 1 would break down. It's not a quirk; it's a deliberate design choice that makes the entire system of permutations and combinations work correctly.
The calculator works for any non-negative integer input. In practice, values up to n = 20 cover almost every textbook and exam scenario. Beyond that, n! grows into numbers with dozens of digits — 25! has 26 digits, for instance. The tool computes these accurately and displays them in full, making it useful for algorithm analysis as well as coursework.
The permutation formula is P(n,r) = n! / (n−r)!, which counts ordered arrangements of r items from a set of n. For example, the number of ways to award gold, silver, and bronze from 10 athletes is P(10,3) = 10!/7! = 720. Use this calculator to find each factorial value separately, then divide to get the final answer.
No — the standard factorial function is only defined for non-negative integers (0, 1, 2, 3, …). Negative integers have no factorial. For non-integer values, mathematicians use the Gamma function (Γ), which generalizes factorial to the real number line. This calculator is designed for whole-number inputs only and will not accept negative or decimal values.
Yes, completely free. There is no account, subscription, or payment required. You can use it on any device — desktop, tablet, or smartphone — without installing anything. It's available whenever you need a quick calculation during class, while studying, or in the middle of a coding session.
A factorial (n!) is a single arithmetic operation — multiply every integer from 1 to n. A combination C(n,r) is a formula that uses factorials to count unordered selections: C(n,r) = n! / (r! × (n−r)!). In other words, combinations are built on top of factorials. To solve a combination problem, you often need to calculate two or three factorials separately and then divide them.
Simply knowing the answer isn't always enough — especially on exams where partial credit depends on showing your work. The step-by-step display lets you see exactly how each multiplication contributes to the final result, identify where the number grows most sharply, and check your manual work line by line. It turns a black-box calculation into a learning tool.