Download Free Trial for
Windows, MacOS

Use MonsterWriter!

The most enjoyable app for writing a thesis or paper.

How to Insert a # Symbol (Hashtag or Number Sign) in LaTeX

You can write a number sign symbol in a LaTeX by typing \#. You can use it the same way in an equation envrionment by typing \(\# \) or $\#$. If you do not escape the number sign you will get the error message shown in listing 2.

\documentclass{article}
\begin{document}
This is a Text containing a number sign symbol $\#$. It is done using an inline equation.
If you write the number sign without inline equation context it looks like this \#.
\end{document}
Listing 1 - Insert a number sign (#) in LaTeX. You can use an inline equation to do so. Within the inline equation place this "\#"
! You can't use `macro parameter character #' in horizontal mode.
l.4 ...nline equation context it looks like this #
Listing 2 - Error message you get when you usse the numbering sign without any equation context.
A LaTeX PDF containing the hastag symbol

The Hashtag Symbol in Social Media

Since 2007 the numbering sign is used in social media to annotate tags.