How to type # (Hash sign)

On macOS, U.S. keyboard:

⇧ Shift+3

See the animated keys

# on every keyboard

SystemLayoutKey combination
macOS French – Numerical ⇧ Shift+@
macOS French ⇧ Shift+@
macOS Belgian ⇧ Shift+@
macOS Swiss French ⌥ Option+3
macOS Canadian Multilingual (CSA) ⇧ Shift+3
macOS Canadian French ⇧ Shift+3
macOS Spanish ⌥ Option+3
macOS Latin American ⇧ Shift+3
macOS U.S. ⇧ Shift+3
macOS ABC ⇧ Shift+3
macOS U.S. International – PC ⇧ Shift+3

What is the hash sign for?

The hash sign # (also “number sign” or “pound sign” in the US) is everywhere:

  • hashtags on social networks: #typography;
  • comments in Python, Ruby, shell or YAML: # This is a comment;
  • Markdown headings: ## Subheading;
  • CSS id selectors and colors: #menu, #E8870E;
  • C preprocessor directives: #include <stdio.h>;
  • anchors in web addresses: /page#section.

Pitfalls

  • The musical sharp ♯ (U+266F) is a different, slanted character used in music notation (C♯). Hashtags and code need the hash sign #.
  • On this layout: ⇧ Shift+3. On French – Numerical: ⇧ Shift+@.

# technical details

Unicode code pointU+0023
Official Unicode nameNUMBER SIGN
HTML entity&#35;
CSScontent: "\23";
JavaScript / JSON"\u0023"
UTF-8 bytes23
URL encoding%23

The official name comes from the Unicode Character Database (ICU).

Related characters