A diacritical mark is a glyph added to a letter or a basic glyph. It comes from a Greek word for "distinguishing". The tilde is a diacritical mark most often seen over the "n" in Spanish, to signify a palatal nasal sound like an "ny". It is also used in Portuguese over a vowel.
The tilde originally was used by medieval European scribes who mostly wrote in Latin. If they came to the end of a line without finishing a word, they left off the final letter and drew a line over the letter after which the letter was omitted. Or they would use it to save space. In Latin, this line was called a titulus, which meant "superscription, something written above or outside something else". It was especially used to abbreviate Latin words ending in "n" or "m". The titulus could also be used within words, thus annus (year) could be abbreviated añus.
|Image courtesy of Vivekanandan Manokaran.|
The use of the tilde in Portuguese for a nasalized vowel comes from using the titulus to abbreviate the nasal consonants "n" and "m". The Portuguese pão, the word for bread, comes from the Latin panis. Another example is mão, "hand", from Lat. manu.
The early Catalan language borrowed the world titulus from Latin and changed it to tilte. The order of the "t" and the "l" was reversed as Latin morphed into Catalan. Spanish changed it further to tilde. A similar letter reversal occurred with the Spanish word cabildo from the Latin capitulum - the chapter of an organization.
In old French the Latin titulus became title, and that word made it into Middle English. It eventually appeared in modern English as the word for a description or name written over a passage or the head of a book as in the title of a book. So tilde and title are the same word etymologically.
There are other uses for the tilde. It is commonly used in math to indicated an estimation or an approximation. You will find it in dictionaries used by itself to mark the omission of the entry world. No doubt it will be employed in other uses as time goes on.
Images from free download sites, except as noted.
For an excellent chart on how to type common diacriticals on a Mac or Windows, click here.