Skip to content
All LaTeX symbols

Tilde symbol (~, ∼, ã)

Accents & decorations

∼

LaTeX command

\sim

binary ∼ (similar, distributed as)

Use inside math mode: $\sim$ — base LaTeX, KaTeX and MathJax

A bare ~ in LaTeX is a non-breaking space, which is why it never prints. For the relation sign use \sim; for an accent use \tilde; for a literal tilde in text (file paths, Unix home directories) use \textasciitilde or the url package.

All ways to write it

CommandUsePackageCopy
\simbinary ∼ (similar, distributed as)none
\tilde{a}accent over one letternone
\widetilde{abc}wide accent over severalnone
\textasciitildeliteral ~ in text modenone
\texttt{\~{}}~ in a monospace path or URLnone
\url{~user}tilde in a URLhyperref, urlnot in KaTeX

Commands marked with a package need that \usepackage line in a LaTeX document. “Not in KaTeX” means the command will not render in KaTeX- or MathJax-based tools such as Markdown previews, Jupyter and Confluence math apps; use one of the other forms there.

Example

\tilde{x} = \frac{x - \mu}{\sigma}, \qquad X \sim \text{Poisson}(\lambda)

A tilde accent for a standardised variable, and ∼ for a distribution.

Questions

Why does ~ print as a space?

In LaTeX ~ is the non-breaking space. Use \textasciitilde (text) or \sim (math) when you want the glyph.

How do I write ~/Documents in LaTeX?

\texttt{\textasciitilde/Documents}, or \path{~/Documents} from the url package.

Related symbols

Using tilde in Confluence

Confluence Cloud has no built-in LaTeX. With LaTeX Math for Confluence you add a math macro to any page, type \sim and it renders inline or as a block, with a live preview while you edit. The app uses KaTeX, so pick one of the commands above that is not marked “not in KaTeX”.