Calculadora de Fatorial

Calcule n! para qualquer inteiro não negativo — na hora

Factorial Calculator

Calculate n! for any non-negative integer

Factorial Calculator

Compute the factorial of a number (n!)

Formula
n! = n x (n-1) x (n-2) x ... x 2 x 1

What is a Factorial Calculator?

A Factorial Calculator is a math tool that computes the factorial of a number, written as n! (pronounced "n factorial"). The factorial operation multiplies a whole number by every whole number below it down to 1. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120.

Factorials are extremely common in probability, statistics, algebra, and combinatorics. They help answer questions like "How many ways can I arrange these items?" or "How many different combinations are possible?" That's why factorials appear in formulas for permutations (arrangements) and combinations (selections).

Because factorial values grow very fast (even 20! is already a huge number), a calculator is the easiest way to get accurate results instantly without manual multiplication errors.

How to Use This Factorial Calculator

  1. Enter a number (n) -- Typically a non-negative whole number (0, 1, 2, 3, ...)
  2. Click "Calculate" -- The calculator computes n!
  3. Review the result -- The output is the factorial value
  4. Try other values -- Factorials grow quickly, so test small and large numbers to see the pattern

Tips:

  • 0! equals 1 (this is a standard math rule)
  • Factorials are usually defined for whole numbers. If you enter a negative number, it's typically invalid
  • Large factorials may be displayed with commas or in scientific notation depending on the page formatting

Formulas

Factorial Definition (for non-negative integers)

n! = n × (n − 1) × (n − 2) × … × 3 × 2 × 1

1! = 1

2! = 2 × 1 = 2

3! = 3 × 2 × 1 = 6

Special Case

Rule: 0! = 1

This is defined by convention to keep formulas consistent

Recursive Form

Rule: n! = n × (n − 1)! for n ≥ 1

Example: 6! = 6 × 5!

Where Factorials Are Commonly Used

  • Permutations: nPr = n! / (n − r)!
  • Combinations: nCr = n! / (r! × (n − r)!)

Example Calculations

Example 1: Compute 5!

Calculation: 5 × 4 × 3 × 2 × 1 = 20 × 3 × 2 × 1 = 60 × 2 × 1 = 120

Result: 120

Example 2: Compute 0!

Rule: By definition, 0! = 1

Result: 1

Example 3: Compute 8!

Calculation: 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 40,320

Result: 40,320

Example 4: Use factorials to compute a combination (10 choose 3)

Formula: 10C3 = 10! / (3! × 7!)

Calculation: (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120

Result: 120 ways

Frequently Asked Questions

What does "n!" mean?

"n!" means factorial. It's the product of all whole numbers from n down to 1. For example, 4! = 4 × 3 × 2 × 1 = 24.

Why is 0! equal to 1?

It's defined that way to keep math formulas consistent—especially in combinations and permutations. For example, the formula for combinations would break in common edge cases if 0! were not equal to 1.

Can I calculate the factorial of a negative number?

Factorials are not defined for negative integers in standard arithmetic. Most factorial calculators will reject negative inputs or return an error.

Why do factorial numbers get so large so quickly?

Factorials grow by repeated multiplication. Each step multiplies by a larger number (e.g., 10! is 10 times bigger than 9!). That rapid growth is why factorials become huge even for moderately sized inputs.

What's the difference between permutations and combinations?

Permutations count arrangements where order matters (ABC is different from ACB). Combinations count selections where order does not matter (ABC is the same group as ACB). Both formulas rely on factorials.

Embed This Factorial Calculator on Your Website

Want to add this factorial calculator to your website? Get a custom embed code that matches your site's design and keeps visitors engaged.

Responsive design
Custom styling
Fast loading
Mobile optimized

O que é um fatorial?

O fatorial de um inteiro não negativo n, escrito n!, é o produto de todos os inteiros positivos de 1 até n. Por exemplo, 5! = 5 × 4 × 3 × 2 × 1 = 120. Os fatoriais aparecem em problemas de contagem, probabilidade, combinatória (combinações e permutações), cálculo (séries de Taylor) e no teorema binomial. Se você já se perguntou de quantas formas pode organizar um conjunto de objetos, a resposta quase certamente envolve um fatorial.

Os fatoriais crescem de forma astronômica — 20! = 2.432.902.008.176.640.000. Mesmo entradas modestas produzem números enormes, por isso calculá-los com precisão exige cuidado. Esta calculadora lida com inteiros grandes com exatidão, mostrando valores exatos para entradas práticas e aproximações bem arredondadas (usando a fórmula de Stirling) para valores de n muito grandes, onde o cálculo exato se torna impraticável.

Como usar a calculadora de fatorial

  1. Digite qualquer inteiro não negativo n no campo de entrada.
  2. Clique em Calcular (ou pressione Enter) para obter o resultado.
  3. Leia o valor exato do fatorial exibido abaixo do campo.
  4. Use o resultado na fórmula de permutações P(n,r) = n! / (n−r)! ou na de combinações C(n,r) = n! / (r! × (n−r)!) conforme necessário.

Fórmula do fatorial e tabela de referência

Definição: n! = n × (n−1) × (n−2) × ... × 2 × 1 Recursiva: n! = n × (n−1)!, com 0! = 1 Casos especiais: 0! = 1 (por definição) 1! = 1 2! = 2 5! = 120 10! = 3.628.800 20! = 2.432.902.008.176.640.000 Combinações: C(n,r) = n! / (r! × (n−r)!) Permutações: P(n,r) = n! / (n−r)!

0! = 1 é uma convenção que faz as fórmulas de combinações e permutações funcionarem corretamente nos casos limite — por exemplo, ao escolher 0 elementos de n ou ao escolher todos os n elementos. Sem essa convenção, as fórmulas falhariam nos seus limites.

Exemplos resolvidos

6! = 720 — Organizar 6 pessoas em uma fila

Se você precisa sentar 6 pessoas em 6 cadeiras em fila, o número de arranjos distintos é 6! = 6 × 5 × 4 × 3 × 2 × 1 = 720. Cada posição tem uma opção a menos que a anterior, então o produto se reduz até chegar a 1.

C(10, 3) = 120 — Escolher 3 de 10

Para saber de quantas formas você pode escolher um comitê de 3 pessoas de um grupo de 10, use C(10, 3) = 10! / (3! × 7!) = 3.628.800 / (6 × 5.040) = 120. A ordem não importa nas combinações.

15! = 1.307.674.368.000

15! = 1.307.674.368.000 — mais de 1,3 trilhão. Isso ilustra o quão rapidamente os fatoriais crescem. Um sistema de senhas com 15 caracteres únicos tem mais de um trilhão de ordenações possíveis, tornando ataques de força bruta computacionalmente caros.

Perguntas frequentes

Por que 0! é igual a 1?
0! = 1 é uma definição, não um cálculo. Ela é escolhida para que as fórmulas de combinações (C(n, 0) = 1) e permutações funcionem corretamente quando r = 0 ou r = n. Matematicamente, também decorre da função gama: Γ(1) = 1, e como n! = Γ(n+1), então 0! = Γ(1) = 1.
Com que rapidez os fatoriais crescem?
Extremamente rápido — mais rápido do que qualquer função exponencial. 10! ≈ 3,6 milhões, 20! ≈ 2,4 quintilhões, e 100! tem 158 dígitos. A aproximação de Stirling, n! ≈ √(2πn) × (n/e)^n, estima fatoriais grandes sem multiplicar todos os inteiros.
Onde os fatoriais são usados em probabilidade?
Os fatoriais são centrais na probabilidade. O número de formas de arranjar n objetos distintos é n!. O coeficiente binomial C(n,r) = n!/(r!(n−r)!) conta os resultados favoráveis em distribuições binomiais. Distribuições de Poisson, testes de permutação e o problema do aniversário também usam aritmética fatorial.
O que é o fatorial duplo?
O fatorial duplo n!! é o produto de todos os inteiros alternados de n até 1 (ou 2). Para n ímpar: n!! = n × (n−2) × ... × 3 × 1. Para n par: n!! = n × (n−2) × ... × 4 × 2. Por exemplo, 7!! = 7 × 5 × 3 × 1 = 105 e 6!! = 6 × 4 × 2 = 48. Fatoriais duplos aparecem em combinatória e física.
Por que os fatoriais são importantes em estatística?
Em estatística, os fatoriais sustentam as regras de contagem usadas em modelos de probabilidade discreta. Aparecem no teorema multinomial, no cálculo de p-valores exatos para o teste exato de Fisher, no número de permutações de testes não paramétricos e em priores bayesianos baseados em raciocínio combinatório. Basicamente, sempre que você contar arranjos ou seleções distintas, um fatorial estará envolvido.