Degree symbol in LaTeX (circ, textdegree, ang)

In math mode the degree sign is a raised circle: $90^\circ$. In text it is \textdegree. For numbers with units, siunitx has \ang{90} for angles and \qty{20}{\degreeCelsius} for temperatures.

Preamble

The snippets on this page need these lines before \begin{document}:

\usepackage{siunitx}

Degrees in a formula

^\circ raises the small circle \circ to the position of an exponent.

A right angle has $90^\circ$, and $\sin 30^\circ = \frac{1}{2}$.
Result
The compiled example

Open in the editor

Degrees in text

\textdegree prints the degree sign and \textcelsius the sign for degrees Celsius. Both are part of LaTeX since 2020; older installations need the textcomp package. The {} after \textcelsius keeps the space that follows, and \, puts a thin space between number and unit.

Turn the dial by 45\textdegree. Water boils at 100\,\textcelsius{} at sea level.
Result
The compiled example

Open in the editor

Angles and temperatures with siunitx

\ang{90} prints an angle; with semicolons it takes degrees, minutes and seconds. \qty{20}{\degreeCelsius} prints a temperature with the correct space, and \unit{\degreeCelsius} the unit alone. The commands work in text and in math mode.

An angle of \ang{90}, a position of \ang{12;30;15}
and a temperature of \qty{20}{\degreeCelsius}.
Result
The compiled example

Open in the editor

Type the character directly

In normal text you can type the degree character from the keyboard; LaTeX reads it as \textdegree. This does not work inside a formula.

Turn the dial by 45° and heat the oven to 180\,°C.
Result
The compiled example

Open in the editor

Pitfalls

Compiled with pdfLaTeX from TeX Live 2023.

Related pages