A palindrome is a fairly well-known term for a word or phrase that reads the same forwards and backwards. For example, “Madam, I’m Adam” is a palindromic phrase, as is “Go hang a salami. I’m a lasagna hog”.
Palindromes get trickier the longer they get: the longest palindrome I know is “A man, a plan, a canal, Panama!” – though somebody with the aid of a dictionary and an algorithm has created the world’s longest palindrome, with 17,826 words that read the same forwards and backwards.
A variant of a palindrome is a semordnilap. They’re like palindromes, but reading the words backwards creates different words, instead (‘semordnilap’ is ‘palindromes’ backwards). For example, diaper / repaid, or stressed / desserts.
An ambigram, however, is different. An ambigram is something that reads the same when you look at it from another direction, orientation or viewpoint. That is to say, if you turn a word upside down, you can still read the same word. Here’s an example, taken from Dan Brown’s book “Angels and Demons”:
Here you can see the four words “earth”, “air”, “fire” and “water” – but if you turn the image upside down, you get this:
The same four words can still easily be read, even though the image has been rotated through 180 degrees.
You can get much more complex ambigrams than these simple ones – check out the Wikipedia page to see more!