Factorial n! & Permutation Formula Solver

Factorial (n!), Permutations (nPr) & Combinations (nCr) Solver

Calculate exact factorials, permutation arrangements, and combination subsets using arbitrary-precision integer math.

Factorial (8!)
40,320

Total distinct orders of 8 items

Combinations C(8, 3)
56

Order does NOT matter (n choose r)

Permutations P(8, 3)
336

Order DOES matter

At a Glance

Category
Combinatorics
Best For
Students and anyone counting arrangements or selections
Privacy
100% in your browser: nothing you enter is uploaded
Time Required
Under a minute
Cost
Free
Updated
November 2026

Quick Overview

What This Tool Does

Computes the factorial of n and uses exact big-number arithmetic to give the permutations and combinations of choosing r items from n. Very large results are shown in scientific notation.

Who Should Use It

Students in probability, statistics and discrete math, teachers, and puzzle or game designers.

When to Use It

When counting arrangements, seating orders, lottery or card combinations, or checking a hand calculation.

Why It Is Useful

Factorials grow very quickly and are easy to get wrong by hand. Exact arithmetic avoids rounding errors.

Key Features & Capabilities

Exact big-number math

Results are calculated exactly, without floating-point rounding.

Permutations and combinations side by side

Choose whether order matters.

Handles large n

Works up to n = 100.

Private

Calculated in your browser.

How to Use This Tool

1

Enter n

Type the total number of items in the set. Tip: n is a whole number from 0 to 100.

2

Enter r

Type how many items you pick. It cannot be larger than n. Tip: Leave r at 0 to see only n!.

3

Read permutations and combinations

Use permutations when order matters and combinations when it does not. Tip: Combinations are always the same as or smaller than permutations.

4

Check the size of the result

Very large values appear as a × 10^exponent. Tip: Factorials exceed a trillion by n = 15.

Worked Real-World Example

Choosing 3 from 8

A club has 8 members and needs to choose 3. We want the number of ordered arrangements and the number of unordered groups.

Sample Inputs
Total set size (n)8
Subset sample size (r)3
Result8! = 40,320; P(8, 3) = 336; C(8, 3) = 56
Calculation Breakdown
Factorial of 8: 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 40,320
Permutations: 8! ÷ 5! = 8 × 7 × 6 = 336
Combinations: 336 ÷ 3! = 336 ÷ 6 = 56
Check: each group of 3 can be arranged in 3! = 6 orders, and 56 × 6 = 336
If the club assigns three different roles (order matters) there are 336 ways. If it just forms a committee of three (order does not matter) there are 56 groups. Each group corresponds to six orderings.

How It Works (Math & Calculation Logic)

n! is the product of all whole numbers from 1 to n, with 0! = 1. Permutations P(n, r) = n! ÷ (n − r)!. Combinations C(n, r) = P(n, r) ÷ r!. The tool uses exact BigInt arithmetic, limits n to 100 and caps r at n.

Formula / Algorithmn! = n × (n − 1) × … × 1 P(n, r) = n! ÷ (n − r)! C(n, r) = n! ÷ (r!(n − r)!)
Variable & Logic Definitions
nSet size - Total number of items (count)
rSubset size - Items chosen (count)

How to Interpret Your Results

Typical Benchmarks

Factorials grow faster than exponentials: 10! is 3,628,800 and 20! is about 2.43 × 10^18. Combination counts are largest when r is near n ÷ 2.

Evaluating Your Output

C(n, r) = C(n, n − r), so choosing r items is the same as leaving out n − r items.

Recommended Next Action

Decide whether order matters before choosing between permutations and combinations: roles and rankings use permutations, groups and hands use combinations.

Frequently Asked Questions

What is a factorial?
n! is the product of all positive integers up to n. For example 5! = 5 × 4 × 3 × 2 × 1 = 120, and 0! is defined as 1.
What is the difference between a permutation and a combination?
In a permutation the order matters (first, second, third place). In a combination the order does not (a group of three people).
How do I calculate nCr?
Use n! ÷ (r! × (n − r)!). For C(8, 3): 40,320 ÷ (6 × 120) = 56.
Why is 0! equal to 1?
It is defined that way so formulas such as C(n, 0) = 1 work, and there is exactly one way to arrange zero items.
How large can n be?
This calculator accepts n up to 100. 100! has 158 digits and is shown in scientific notation.

Complementary QuickForma Utilities