How to type ~ (Tilde)

On macOS, U.S. keyboard:

⇧ Shift+`

See the animated keys

~ on every keyboard

SystemLayoutKey combination
macOS French – Numerical ⌥ Option+NthenSpace Dead key
macOS French ⌥ Option+NthenSpace Dead key
macOS Belgian ⌥ Option+NthenSpace Dead key
macOS Swiss French ⌥ Option+NthenSpace Dead key
macOS Canadian Multilingual (CSA) ⌥ Option+Ç
macOS Canadian French ⇧ Shift+`
macOS Spanish ⌥ Option+ÑthenSpace Dead key
macOS Latin American ⌥ Option+Ñ
macOS U.S. ⇧ Shift+`
macOS ABC ⇧ Shift+`
macOS U.S. International – PC ⇧ Shift+`thenSpace Dead key

What is the tilde for?

The tilde ~ has several uses:

  • home folder in the macOS and Linux terminal: cd ~/Documents;
  • approximately: “~20 minutes” means “about 20 minutes”;
  • bitwise NOT in C, JavaScript and Python: ~x;
  • version ranges in package managers: ~1.4;
  • in Spanish and Portuguese, it is the accent on ñ, ã or õ.

Pitfalls

  • On many Mac layouts the tilde is a dead key: nothing appears on the first press, because it waits for the next letter to make ñ or õ. To get the tilde on its own, finish with Space, as the animation shows.
  • The small tilde ˜ (U+02DC) looks similar but the terminal does not understand it. If cd ~ fails after copy-pasting, check the character.
  • On this layout: ⇧ Shift+`. On French – Numerical: ⌥ Option+NthenSpace.

~ technical details

Unicode code pointU+007E
Official Unicode nameTILDE
HTML entity~
CSScontent: "\7E";
JavaScript / JSON"\u007E"
UTF-8 bytes7E
URL encoding~

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

Related characters