Palindrome Checker determines if a word, phrase, or number reads the same forwards and backwards. Enter any text to see if it's a palindrome ā with options to ignore spaces, punctuation, and capitalization. It also finds palindromic substrings within longer text, checks if a number is palindromic, and provides examples of famous palindromes.
A palindrome is a word, number, phrase, or sequence that reads the same forwards as backwards. Classic examples: 'racecar', 'level', 'civic', 'madam', 'noon', '12321'. Famous phrases: 'A man, a plan, a canal: Panama' and 'Was it a car or a cat I saw?' are palindromes when spaces and punctuation are removed. Palindromic numbers: 121, 1001, 12321. In mathematics, palindrome detection is a classic string algorithm problem.
Applications of palindrome detection: string algorithm interviews (palindrome problems are classic coding interview questions), DNA sequence analysis (palindromic DNA sequences are recognition sites for restriction enzymes used in genetic engineering), validation algorithms (the Luhn algorithm has palindrome-like properties), and text analysis for games and word puzzles.
Check a phrase
Result: 'A man a plan a canal Panama' (ignore spaces + case) ā ā Palindrome
Number palindrome
Result: 12321 ā ā Palindrome / 12345 ā ā Not a palindrome
Longest palindromic substring
Result: 'racecar driver' ā longest palindrome substring: 'racecar' (7 chars)
What are some of the longest palindromes in English?
Long word palindromes: 'detartrated' (11 letters, past tense of 'to detartrate'). 'tattarrattat' (12 letters, coined by James Joyce in Ulysses for a door knock sound). Long phrase palindromes: 'A man, a plan, a canal: Panama' (21 letters). 'Was it a car or a cat I saw?' (19 letters). The longest constructed palindromic sentences in English run thousands of characters.
What is a Semordnilap?
A semordnilap (palindromes spelled backward) is a word that spells a different word backward, also called a heteropalindrome or word reversal. Examples: 'dog'/'god', 'live'/'evil', 'desserts'/'stressed', 'stressed'/'desserts', 'deliver'/'reviled'. Not palindromes (they don't read the same forwards and backwards) but a related wordplay concept. The word 'semordnilap' is itself 'palindromes' spelled backwards.
How is palindrome detection relevant in DNA biology?
In molecular biology, palindromic DNA sequences are sequences where the complement strand reads the same in the 5' to 3' direction. Example: GAATTC (EcoRI restriction site) ā the complement is CTTAAG which reversed is GAATTC. These palindromic sequences are recognition sites for restriction enzymes ā proteins that cut DNA at specific palindromic sequences. This is fundamental to molecular cloning, PCR, and genetic engineering.
What is Longest Palindromic Substring (LPS) and how is it computed?
Finding the longest palindromic substring is a classic algorithm problem. Naive approach: O(n³) ā check all substrings. Dynamic programming (DP): O(n²) time and space. Manacher's algorithm: O(n) time ā the optimal solution. In coding interviews, the DP approach is most commonly expected. Expand-around-center is a common interview solution: for each character, expand outward checking for palindromes ā O(n²) time, O(1) extra space.
Are there palindromic numbers in every number system?
Yes ā palindromic numbers exist in any base. In binary: 0, 1, 3 (11), 5 (101), 7 (111), 9 (1001)... A number can be palindromic in one base but not another: 9 is '9' in decimal (not palindromic), '1001' in binary (palindromic), '100' in base-3 (not palindromic). The Lychrel conjecture: take any number, reverse it, add them ā repeat. Most numbers reach a palindrome. 196 is the most famous candidate that may never reach a palindrome.