left-arrow-icon
factorial-icon

Factorial Calculator

Calculate Factorial of a number. Learn more about 0 factorial, 100 factorial, negative factorial and formula for calculating n factorial

HomeMath

Factorial


Find the factorial of the given number

Factorial is

copy icon     Copy
9.332621544394418e+157

What is factorial?

factorial icon
  • Meaning of Factorial:

    Factorial of a number is the result we get on multiplication of the given number by all numbers below it upto 1. It is only applicable to integers > 0. For eg. Factorial of 3 is equal to 3 x 2 x 1 = 6

    Notation: Factorial of a number is denoted by the exclamation symbol followed by the number.(x!) or Fact(x).

  • Factorial Formula .

    (factorial of n) n! =n x (n-1) x (n-2) x ....1 = n x (n-1)!

  • Factorial example.

    1! = 1
    2! = 2x1 = 2
    3! = 3x2x1 = 6
    4! = 4x3x2x1 = 24
    5! = 5x4x3x2x1 = 120

How to Use the Factorial Calculator?

Factorial icon

    The factorial calculator tool is simple to use.

  • Simply enter the number for which factorial is required in Input field
  • The factorial for that number is displayed in the output box automatically as you complete the input.

Note: The maximum allowed input is 170.

Formula used by Factorial Function Calculator

Factorial icon
  • n Factorial Formula

    As we know that we have a formula for finding the factorial of the given number.So lets see how to implement the formula and get the result.

    It is n x (n-1) x (n-2) x ....x 1

    Factorial of 5
    According to our formula n =5. 5! = 5 x (5-1) x (5-2) x (5-3) x..1
    5! = 5 x 4 x 3 x 2 x 1
    5! = 120

Fastest way to calculate factorial

Factorial icon

    By Iteration

  • Use a for loop with i as the given number whose factorial is needed and with end condition where i >=1, increment i
  • Inside the for loop, multiply with i and store it in a variable which is initialized to 1 outside the loop
  • A snippet in javascript input is the number whose factorial is needed.

                                            var input = 5;
                                            var result = 1;
                                            for (let i = input; i >= 1; i--)  {
                                              result = result * i;
                                            }
                                        
  • result has the output of the factorial

    By Recursive Function

  • Write a function let's say
                                            getFactorial(input)
                                                if (input === 0) {
                                                   return 1;
                                                   }
                                                else {
                                                   return input * this.getFactorial(input - 1);
                                                  }
                                                }
                                            getFactorial(input) {
                                                    return input === 0 ? 1 : input * getFactorial(input -1);
                                            }
                                        

0 Factorial / Zero Factorial

  • Factorial of 0 is 1.

    Lets discuss how 0! is 1.

    We know that n! = n x (n-1)! ==> n = n!/(n-1)! this means the following,

    (n-1)! = n!/n

    if n = 1

    it becomes 0! = 1!/1 = 1

    From the above we conclude that Zero Factorial is 1

Is there a Negative Factorial

Factorial Icon
  • No, there is no negative factorial.

  • Factorials are defined only for non-negative integers. For example, the factorial of 4 is 24, the factorial of 0 is 1, and the factorial of -1 is undefined.

  • One reason for this is that factorials are used to count the number of ways to arrange or select objects. For example, there are 6! ways to arrange 6 different objects in a row. However, there is no such thing as a negative number of objects, so it does not make sense to define a factorial for a negative number.

  • Another reason for not defining negative factorials is that it would lead to mathematical contradictions.

Interesting Facts About Factorials

Interesting Icon
  • Factorials grow very quickly. For example, 5! is 120, 10! is over 3.6+ million and 15! is 1.3 x 10^12 which is million of million.

  • The largest factorial that can be calculated on a standard computer is 170!.

  • Factorials are related to the Fibonacci sequence. The Fibonacci sequence is a sequence where each number is the sum of the two previous numbers like 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...

  • The factorial of a prime number is always greater than the prime number itself.

  • The factorial of a number is equal to the product of all the positive integers less than or equal to that number.

Where are Factorials Used?

Interesting Icon
Factorials are used in many different areas such as finance, mathematics, manufacturing, genetics, medical research, sports wherever probability, permutation and combination or predictive analytics is applicable.
  • Factorials can be used to calculate the probability of certain events happening. For example, the probability of rain occuring in an area in a given period of time.

  • Factorials are also useful to find the permutation of things. For eg, no of ways 3 guests can be seated in 3 chairs will be 3! = 3x2x1 = 6 different ways.

  • Combinatorics is a branch of mathematics dealing with counting and arranging. Factorials is applicable in this area to find the number of different ways a particular item or thing can be arranged or counted. Example: Selecting 4 fruits from a set of 10 fruits will have a combination given by the formula below: C(n,r)=n!/r!(n-r!) where n = 10 and r = 4 in our example.

  • In sports, factorial is used in predicting probability of win, loss or draw of a match based on current data available , predicting players performance against teams based on historical data.

  • Factorials are used in number theory to study the properties of prime numbers and other types of numbers.

  • Factorials are used in finance to calculate the price of stocks, shares and predict fluctuations.

  • Factorials are used in genetics to calculate the probability of inheriting certain traits and diseases. It is used in medical research for evaluating data from clinical and research trials and predicting outcomes from a random sample

  • Factorials are used in manufacturing to calculate the number of ways to assemble and package products.

  • Factorials are used in logistics to calculate the number of ways for routing with no of vehicles

Table of Factorial Numbers

Conversion Table Icon
Factorial of Factorial Value
Factorial of 1 1
Factorial of 2 2
Factorial of 3 6
Factorial of 4 8
Factorial of 5 120
Factorial of 6 720
Factorial of 7 5040
Factorial of 8 40320
Factorial of 9 362880
Factorial of 10 3628800
Factorial of 11 3.99168 E+7
Factorial of 12 4.790016 E+8
Factorial of 13 6.2270208 E+9
Factorial of 14 8.71782912 E+10
Factorial of 15 1.307674368 E+12
Factorial of 16 2.092278988 E+13
Factorial of 17 3.55687428 E+14
Factorial of 18 6.402373705 E+15
Factorial of 19 1.216451004 E+17
Factorial of 20 2.432902008 E+18
Factorial of 21 5.109094217 E+19
Factorial of 22 1.124000727 E+21
Factorial of 23 2.585201673 E+22
Factorial of 24 6.204484017 E+23
Factorial of 25 1.551121004 E+25
Factorial of 26 4.032914611 E+26
Factorial of 27 1.088886945 E+28
Factorial of 28 3.048883446 E+29
Factorial of 29 8.841761993 E+30
Factorial of 30 2.652528598 E+32
Factorial of 31 8.222838654 E+33
Factorial of 32 2.631308369 E+35
Factorial of 33 8.683317618 E+36
Factorial of 34 2.95232799 E+38
Factorial of 35 1.033314796 E+40
Factorial of 36 3.719933267 E+41
Factorial of 37 1.376375309 E+43
Factorial of 38 5.230226174 E+44
Factorial of 39 2.039788208 E+46
Factorial of 40 8.159152832 E+47
Factorial of 41 3.345252661 E+49
Factorial of 42 1.405006117 E+51
Factorial of 43 6.041526306 E+52
Factorial of 44 2.658271574 E+54
Factorial of 45 1.196222208 E+56
Factorial of 46 5.502622159 E+57
Factorial of 47 2.586232415 E+59
Factorial of 48 1.241391559 E+61
Factorial of 49 6.08281864 E+62
Factorial of 50 3.04140932 E+64
Factorial of 51 1.551118753 E+66
Factorial of 52 8.065817517 E+67
Factorial of 53 4.274883284 E+69
Factorial of 54 2.308436973 E+71
Factorial of 55 1.269640335 E+73
Factorial of 56 7.109985878 E+74
Factorial of 57 4.05269195 E+76
Factorial of 58 2.350561331 E+78
Factorial of 59 1.386831185 E+80
Factorial of 60 8.320987112 E+81
Factorial of 61 5.075802138 E+83
Factorial of 62 3.146997326 E+85
Factorial of 63 1.982608315 E+87
Factorial of 64 1.268869321 E+89
Factorial of 65 8.247650592 E+90
Factorial of 66 5.44344939 E+92
Factorial of 67 3.647111091 E+94
Factorial of 68 2.480035542 E+96
Factorial of 69 1.711224524 E+98
Factorial of 70 1.197857166 E+100
Factorial of 71 8.504785885 E+101
Factorial of 72 6.123445837 E+103
Factorial of 73 4.470115461 E+105
Factorial of 74 3.307885441 E+107
Factorial of 75 2.480914081 E+109
Factorial of 76 1.885494701 E+111
Factorial of 77 1.45183092 E+113
Factorial of 78 1.132428117 E+115
Factorial of 79 8.94618213 E+116
Factorial of 80 7.156945704 E+118
Factorial of 81 5.79712602 E+120
Factorial of 82 4.753643337 E+122
Factorial of 83 3.945523969 E+124
Factorial of 84 3.314240134 E+126
Factorial of 85 2.817104114 E+128
Factorial of 86 2.422709538 E+130
Factorial of 87 2.107757298 E+132
Factorial of 88 1.854826422 E+134
Factorial of 89 1.650795516 E+136
Factorial of 90 1.485715964 E+138
Factorial of 99 9.332621544 E+155
Factorial of 100 9.332621544 E+157
Factorial of 120 6.689502913 E+198
Factorial of 150 5.713383956 E+262
Factorial of 175 1.124449491 E+318
Factorial of 200 7.886578673 E+374
Factorial of 300 3.060575122 E+614
Factorial of 365 2.510412867 E+778
Factorial of 500 1.220136825 E+1134
Factorial of 1000 4.0238726 E+2567
Factorial of 10000 2.84625968 E+35659

Frequently Asked Questions on Factorial Calculation

FAQ icon

  • Yes, Factorials grow much faster than exponents.

    Exponential growth is 2 ^ n or any base ^ n where the base can be 2, 3, 5 , 10 or any number. The number remains the same and only the power is multiplied 'n' number of times.

    Factorial growth uses higher and higher numbers with every increment. Initially, it appears as a small growth but quickly reaches infinity. For eg from 5! to 10! it goes from 120 to 3 million.

  • No, Iteration is always faster than recursion. Recursion can be more efficient in terms of programming but iteration is simpler and performs better.

    A recursion is when a function calls itself within itself continuously till it exits the processing loop under some condition

    In terms of memory, the recursion uses more memory as each call of the function is pushed to a stack till the entire computation is completed. It can go out of memory if the computation is big.

    In iteration, the function is invoked or computation is done inside a loop for a definite count.

  • Every factorial can be expressed in terms of another factorial. As it's a repetitive pattern, it's efficient to use a recursive function to compute factorials.
    for eg 100! = 100 x 99!
    25! = 25 x 24!
    5! = 5x4!
    2! = 2 x 1!

  • You can calculate factorial by Iterative Method or Recursive Method
    To find the factorial of a given number with iterative method , multiply the number with all previous numbers till 1.
    This will be done in a loop
    To find the factorial of a given number using Recursive method,
    create a recursive function that returns the product of the given number with the output of the recursive function which takes n-1 as the input.
    it returns 1 when the input to the recursive function is 0.