Overview
The tilde, written as the single character ~, is a small wavy mark with diverse functions across languages, typography, mathematics and computing. It appears both as an independent punctuation-like symbol and as a diacritic placed over letters. Because of this flexibility, the tilde is one of the few glyphs that carries distinct technical meanings in linguistics, plain text computing and informal notation.
In writing and speech
As a diacritic the tilde modifies pronunciation in several languages. In Spanish the tilde appears only above the n, producing the distinct letter ñ, which represents a palatal nasal sound like the 'ny' in English "canyon"; this use makes Spanish ñ a separate orthographic character in its alphabet. In Portuguese the tilde placed over vowels such as ã and õ indicates nasalization, changing the vowel quality by allowing airflow through the nose. Related usages occur in other Iberian and Latin American languages, and in transcription systems: the International Phonetic Alphabet uses a tilde to mark nasalized vowels.
Typographic and linguistic characteristics
The tilde can function as a combining diacritic or as a standalone character. In many alphabets the mark is combined directly with a letter; in others the tilde acts as a separate symbol to indicate approximation or omitted letters. For a general discussion of diacritics and their roles see diacritic. In phonetics, a tilde placed above or through a letter commonly denotes nasalization or particular articulation properties.
In computing, mathematics and keyboards
In computing the tilde has several widely used meanings. On Unix-like systems the character is conventionally shorthand for a user's home directory in shells and file paths; this convenience makes it common in command-line examples and scripts (UNIX). Many programming languages treat the tilde as an operator — for example a bitwise NOT in some C-like languages — and it is also used in pattern matching, informal approximation and certain markup syntaxes. Mathematically, a tilde frequently denotes equivalence relations or approximations (for instance, to indicate that two quantities are asymptotically similar or that a value is approximate).
On most modern QWERTY keyboards the tilde shares a key with the grave accent (`) in the upper-left area of the main key cluster; see keyboard layout references for placement details (QWERTY). Typing a visible tilde often requires pressing Shift plus that key on many layouts. Basic keyboard conventions and related punctuation notes can be found via keyboard punctuation guides.
History and origin
The tilde traces its roots to medieval shorthand practices. Scribes placed a small curly stroke over letters to indicate omitted n or m letters when writing Latin and Romance languages; over time this shorthand evolved into a distinct diacritic. The Spanish letter ñ originated from such an abbreviation: an n written above another n eventually became the single character with a tilde. This scribal origin explains why the tilde became associated with nasal consonants and vowels in the languages that adopted it.
Common conventions, distinctions and notable facts
- In informal notation the tilde preceding a number, as in ~24, commonly means "approximately 24".
- Different disciplines use the tilde for different relationships: linguists use it for nasalization, mathematicians for equivalence or asymptotic similarity, and computer users for file paths and operators.
- Some collaborative platforms and wikis have specific keyboard conventions: for example, editors on certain sites type four tildes in sequence to trigger an automatic signature and timestamp (~~~~).
- Because the mark appears both above letters and as a free-standing glyph, its typographic rendering varies by font and language setting. Software will often use a combining form when needed for accented letters.
For practical how-to details—such as typing tildes on particular operating systems, using them in programming languages, or learning their phonetic implications—see linked resources about diacritics and layout conventions: what is a diacritic?, Spanish usage, Portuguese usage, Unix conventions, keyboard layout, and punctuation tips.