What the degree symbol means
The degree sign ° is a small raised circle that marks three kinds of degrees: temperature (20 °C, 68 °F), angles (a 90° right angle, a 360° turn) and geographic coordinates (51° N). It is one character, DEGREE SIGN (U+00B0), and the same sign serves Celsius and Fahrenheit alike: the letter after it tells you the scale.
Angles split further into minutes and seconds, written with the prime ′ and double prime ″: 1° = 60′ and 1′ = 60″, so a position can be written 40° 26′ 46″ N. Maps and GPS apps often use decimal degrees instead, such as 40.7128° N, 74.0060° W for New York City.
Spacing differs by use. SI style puts a space before °C and °F (20 °C) but none before the degree of an angle (90°). Kelvin is the exception to the family: since 1967 it is written K with no degree sign, as in 300 K. Weather in the US is given in °F, while most other countries use °C; the Celsius symbol page has a quick conversion guide.
Degree sign look-alikes
Several small circles look like ° but are different characters. Using them can make text look slightly off and breaks search, because 20º and 20° are not the same string.
º is the masculine ordinal indicator, used in Spanish, Portuguese and Italian (1º, Nº); in some fonts it has a line under it. ˚ is the ring above, a spacing accent. ⁰ is a superscript zero for exponents, and ∘ is the ring operator for function composition (f ∘ g).
On a Mac, Option + 0 types º and Option + K types ˚, which is how many people end up with the wrong one. The real degree sign is Option + Shift + 8.
How to type the degree symbol
Windows: hold Alt and type 0176 on the number pad (or Alt + 248) with Num Lock on. In Word, you can also type 00B0 and press Alt + X, or press Ctrl + Shift + @, release, then press Space.
Mac: Option + Shift + 8. iPhone: long-press 0 on the number keyboard and slide to °. Android with Gboard: tap ?123, then =\<, and tap °. Linux and ChromeOS: press Ctrl + Shift + U, type b0, then press Space or Enter.
Google Docs: Insert > Special characters, then search for "degree". Excel: =UNICHAR(176). HTML: °. LaTeX: ^\circ in math mode, or \degree with the gensymb package. For angle signs such as ∠, see angle symbols.