Does it read the same forwards and backwards?
A palindrome is a word, phrase, number, or sequence that reads the same forwards and backwards. The simplest examples are single words. level, civic, racecar, radar, madam, rotor, kayak, noon, refer. Longer palindromes work as full sentences once you ignore spaces, punctuation, and capitalization.
The word itself comes from the Greek palin ("again") and dromos ("running" or "direction"). Literally, "running back again." The English term was coined by the writer Henry Peacham in 1638. Palindromes have been studied by mathematicians, linguists, geneticists, and puzzle-makers for over two thousand years.
Some of the most famous palindromes in English literature and pop culture include:
Author Dmitri Borgmann documented hundreds of these in Language on Vacation (1965). The Oulipo group, including Georges Perec, treated palindrome construction as a literary form. Perec's 1969 palindrome "Au moulin d'Andé" runs over 1,200 words and remains one of the longest deliberate palindromes in any language.
The check itself is simple: reverse the string and compare it to the original. The trick is what you do before reversing. Most palindrome checks normalize the input by removing punctuation, stripping spaces, and lowercasing everything. Otherwise "Madam, I'm Adam" never registers because the comma and apostrophe don't have mirror images.
function isPalindrome(str) {
const clean = str.toLowerCase().replace(/[^a-z0-9]/g, '');
return clean === clean.split('').reverse().join('');
}
isPalindrome("A man, a plan, a canal: Panama"); // true
isPalindrome("racecar"); // true
isPalindrome("hello"); // false
import re
def is_palindrome(s: str) -> bool:
clean = re.sub(r'[^a-z0-9]', '', s.lower())
return clean == clean[::-1]
is_palindrome("Was it a car or a cat I saw?") # True
is_palindrome("12321") # True
is_palindrome("python") # False
Both versions handle the three normalization steps in one expression: lowercase, strip non-alphanumerics, then compare to the reversed string. For very large inputs you can save memory with a two-pointer approach (one pointer at the start, one at the end, walking inward), but for any input a human will type, the one-liner is plenty fast.
Palindromic numbers. Like 121, 1221, and 12321. Are an active area of recreational mathematics. Every single-digit number is technically a palindrome. Among multi-digit palindromes, the ones that are also prime are especially studied: 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929. Mathematicians have proven there are infinitely many palindromic numbers but it remains an open question whether there are infinitely many palindromic primes in base 10.
The Lychrel number conjecture asks whether every number eventually produces a palindrome when you repeatedly reverse-and-add it (e.g., 87 → 87+78=165 → 165+561=726 → 726+627=1353 → 1353+3531=4884, palindrome). Most numbers reach a palindrome quickly. Some, like 196, have been carried through millions of iterations without producing one. A candidate Lychrel number.
DNA contains palindromic sequences too, but with a twist: a DNA palindrome is a sequence where the strand reads the same as its complementary strand read backwards. The sequence GAATTC is a palindrome because the complementary strand reads CTTAAG. Which, read 3' to 5', is also GAATTC.
This matters in molecular biology because restriction enzymes. The proteins biologists use to cut DNA at specific sites. Recognize palindromic sequences. EcoRI cuts at GAATTC. BamHI cuts at GGATCC. The palindromic structure means the enzyme binds symmetrically, making it possible to cut both strands at predictable positions. Without DNA palindromes, modern genetic engineering wouldn't work the way it does.
A palindrome reads the same in both directions. Same letters, same order, just mirrored. An anagram is a word or phrase formed by rearranging the letters of another. "Listen" → "silent" is an anagram. "Level" → "level" is a palindrome. The two are completely different operations: palindromes are about direction; anagrams are about rearrangement. A word can be both (palindromes are anagrams of themselves), but most aren't.
A palindrome is a word, phrase, number, or sequence that reads the same forwards and backwards. Examples: "racecar", "madam", "A man, a plan, a canal: Panama". Most palindrome checkers ignore spaces, punctuation, and capitalization.
Yes. By default the checker strips punctuation, removes spaces, and lowercases the text before comparing. So "A man, a plan, a canal: Panama" registers as a palindrome. You can toggle each option using the controls above.
"Tattarrattat" (12 letters), coined by James Joyce in Ulysses, is among the longest single-word palindromes. For palindromic sentences, "A man, a plan, a canal: Panama" is the most famous, and Dan Hoey's computer-generated 17,826-character palindrome holds the construction record.
Yes. "12321" and "1001" are numeric palindromes. Mathematicians study palindromic primes (palindromes that are also prime numbers, like 131 and 757) and the open Lychrel conjecture about whether every number eventually produces one through reverse-and-add iteration.
A palindrome reads the same in both directions ("level"). An anagram is a rearrangement of letters to form another word ("listen" → "silent"). They're unrelated concepts. Palindromes are about direction, anagrams are about rearrangement.
Yes. DNA palindromes are sequences where one strand reads the same as its complementary strand backwards (e.g., GAATTC). Restriction enzymes recognize these palindromic sites and use them to cut DNA at predictable positions. Fundamental to genetic engineering.