How to type ~ on a Spanish keyboard
⌥ Option+ÑthenSpace
Hold Option and press “Ñ”. Release everything, then press Space.
This is a dead key: nothing appears on the first press, that is expected.
Not your keyboard? You are viewing: Spanish
Try it on your keyboard: the keys you press light up.
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: ⌥ Option+ÑthenSpace. On French – Numerical: ⌥ Option+NthenSpace.
~ on each layout
| System | Layout | Key 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 |
Other methods
- ⌥ Option+Ñthen⌥ Option+I Hold Option and press “Ñ”. Release everything, then hold Option and press “I”.
- ⌥ Option+Ñthen⌥ Option+L Hold Option and press “Ñ”. Release everything, then hold Option and press “L”.
- ⌥ Option+Ñthen⌥ Option+N Hold Option and press “Ñ”. Release everything, then hold Option and press “N”.
- ⌥ Option+Ñthen⌥ Option+U Hold Option and press “Ñ”. Release everything, then hold Option and press “U”.
Character Viewer
Press fn + E (or Control + Command + Space) to open the Character Viewer, search for “~” by name, then double-click it to insert it.
Text replacement
In System Settings › Keyboard › Text Replacements, map a shortcut (for example “;;x”) to the character ~: it will be inserted automatically in most apps.
~ technical details
| Unicode code point | U+007E |
|---|---|
| Official Unicode name | TILDE |
| HTML entity | ~ |
| CSS | content: "\7E"; |
| JavaScript / JSON | "\u007E" |
| UTF-8 bytes | 7E |
| URL encoding | ~ |
The official name comes from the Unicode Character Database (ICU).
Related characters
Report a mistake
The combination does not work for you? Tell us what happens (macOS version, keyboard, what appears).