What the tilde means
- Approximately:
~5 minutes,~$200. Common in notes, chats and technical writing. In formal text, write “about,” or use ≈ in math. - Home directory: on macOS, Linux and other Unix-like systems,
~is your home folder, so~/Documentsis the Documents folder inside it. - Bitwise NOT: in C, Java, JavaScript and Python,
~xflips every bit of an integer. - Version ranges: in npm,
~1.2.3allows patch updates (1.2.x) but not minor ones. - Statistics:
X ~ N(0, 1)means X follows a standard normal distribution. - Old personal web pages: addresses like
example.edu/~jsmithpointed to a user’s own page on a university server.
The tilde as an accent: ñ, ã, õ
As a diacritic, the tilde sits on top of a letter: ñ in Spanish (año, jalapeño, piñata) and ã or õ in Portuguese (São Paulo). These are separate letters, not a tilde typed next to n.
- Mac: press Option+N, then the letter. Option+N followed by n gives ñ.
- Windows: hold Alt and type 0241 for ñ or 0209 for Ñ on the numeric keypad. The US-International keyboard layout also lets you type the tilde key and then n.
- iPhone and Android: long-press n and pick ñ.
Look-alikes: ˜ (small tilde) is a spacing accent mark, ∼ (tilde operator) is a math symbol, 〜 (wave dash) marks ranges in Japanese, and ≈ means “almost equal to.”
Finding the key and avoiding Markdown surprises
On US keyboards, the tilde shares a key with the backtick at the top left, below Esc. Press it with Shift. The key is in the same place on Mac and Windows keyboards.
In Markdown with GitHub-style extensions, tildes around text produce strikethrough. If a line like ~10 to ~20 people comes out crossed through, put a backslash before each tilde or wrap the text in a code span.
In URLs, the tilde is an unreserved character, so it never needs percent-encoding, although some older tools still turn it into %7E.
Frequently asked questions
Where is the tilde key on a keyboard?
On US keyboards, it is the key left of 1, below Esc. Hold Shift while pressing it to get ~.
What does ~ mean before a number?
Approximately. ~30 means about 30.
How do I type ñ?
On a Mac, press Option+N, then n. On Windows, hold Alt and type 0241 on the numeric keypad. On phones, long-press n.
What does ~ mean in a file path?
Your home folder on macOS and Linux. ~/Downloads is the Downloads folder in your home directory.
Unicode data: Unicode Character Database 18.0.0 (unicode.org).