How to use factorial(!) symbol in LaTeX?

A popular symbol used in mathematics is factorial, no command is required to print this symbol in a latex document.

Type of symbolMathematics
Package (requirement)No
Latex command!
Examplea! → a!

Type shift + 1 for factorial

Just use bang or exclamation point key shift + ! 1 on your keyboard.

   \[ n! = n(n-1)(n-2)\cdots (2)(1) \] 
   \[ \frac{(n+1)!}{n!} \]
   \[ \frac{(2n+2)!+(n!)^2}{((n+1)!)^2 (2n)!} \]

Output :

Use factorial symbol in latex.

Add space in factorial

When using multiple factorials side by side, the space between them is not correct.

In that case, you can use the following commands in LaTeX to provide spaces: \,, \enspace, \quad. The example below shows how much space these commands provide.

  \[  \frac{1}{m!n!} \rightarrow \verb|{m!n!}| \]
  \[ \frac{1}{m!\,n!} \rightarrow \verb|{m!\,n!}| \]
  \[ \frac{1}{m!\enspace n!} \rightarrow \verb|{m!\enspace n!}| \]
  \[ \frac{1}{m!\quad n!} \rightarrow \verb|{m!\quad n!}| \]

Output :

use space in factorial.

In terms of spacing, you can see that \enspace and \quad use the command to take more space than \, , which doesn’t look very good.

But it looks much better to see that the space has been properly maintained using the \, command. so I would recommend using \, it in this case.

Inverse factorial symbol in LaTeX

Generally, the inverse factorial symbol is not used that much, but if you need this symbol at some point, then using the backtick ` symbol next to the factorial ! symbol will print the inverse factorial symbol in the latex document, use it like this !`. And you have to use it in text mode.

  ! $ \rightarrow $ \verb|Factorial symbol|\\[6pt]
  !` $ \rightarrow $ \verb|Inverse factorial symbol|

Output :

Inverse factorial symbol in latex.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top