An anagram is direct word switch or word play, the result of rearranging the letters of a word or phrase to produce a new word or phrase, using all the original letters exactly once; for example, the word anagram can be rearranged into nag-a-ram. Someone who creates anagrams may be called an "anagrammatist". The original word or phrase is known as the subject of the anagram. Anagrams are often used as a form of mnemonic device as well.
Any word or phrase that exactly reproduces the letters in another order is an anagram. However, the goal of serious or skilled anagrammatists is to produce anagrams that in some way reflect or comment on the subject.
Such an anagram (reflecting or commenting on the subject) may be a synonym or antonym of its subject, a parody, a criticism, or praise. It sometimes changes a proper noun or personal name into a sentence, such as with "William Shakespeare" = "I am a weakish speller" or "Madam Curie" = "Radium came". It can change parts of speech, such as the adjective "silent" to the verb "listen". "Anagrams" itself can be anagrammatized as "Ars magna" (Latin, 'the great art').
Anagrams can be traced back to the time of Moses, as "Themuru" or changing, which was to find the hidden and mystical meaning in names. They were popular throughout Europe during the Middle Ages, for example with the poet and composer Guillaume de Machaut. They are said to go back at least to the Greek poet Lycophron, in the third century BCE; but this relies on an account of Lycophron given by John Tzetzes in the 12th century.
Anagrams in Latin were considered witty over many centuries. "Est vir qui adest", explained below, was cited as the example in Samuel Johnson's A Dictionary of the English Language.
Any historical material on anagrams must always be interpreted in terms of the assumptions and spellings that were current for the language in question. In particular, spelling in English only slowly became fixed. There were attempts to regulate anagram formation, an important one in English being that of George Puttenham's Of the Anagram or Posy Transposed in The Art of English Poesie (1589).