Palindrome Checker - Instant Text Validation Tool (Free)
Check if text reads the same forwards and backwards. This free palindrome checker ignores spaces, punctuation, capitals, and accents for accurate results.
Palindrome Checker
Examples
- "racecar" - Yes, it's a palindrome!
- "A man a plan a canal Panama" - Yes, it's a palindrome!
- "hello" - No, not a palindrome
Documentation
What Is a Palindrome Checker?
A palindrome checker is a tool that tests whether a piece of text reads the same forwards and backwards. It ignores spaces, punctuation, and capital letters, so a sentence like "A man, a plan, a canal: Panama" counts as a palindrome even though it is not identical character for character when reversed.
How to Use This Palindrome Checker
- Type or paste a word, phrase, or number into the input box.
- The result appears right away: "Yes, it's a palindrome!" or "No, not a palindrome".
- Read the "Cleaned text" line to see exactly what was compared.
- Use "Reset" to clear the input and start over.
An example list below the input shows "racecar" and "A man a plan a canal Panama" as palindromes and "hello" as not a palindrome. Input that is empty or only spaces shows no result.
The check runs in the browser. No text is sent to a server.
How the Palindrome Checker Works
The tool works in two steps.
Step 1: Clean the text
Before comparing, the text is cleaned:
- Accented letters are folded to their plain base letter. Γ becomes e, Γ‘ becomes a.
- The text is converted to lowercase.
- Anything that is not a letter or a digit is removed, including spaces, commas, periods, and other punctuation.
This step keeps letters from any alphabet, not just the 26 letters used in English. Cyrillic, Greek, Hebrew, and Chinese text are cleaned the same way, so palindromes written in other languages are detected correctly too.
Step 2: Compare the text with its reverse
The cleaned text is reversed and compared, letter by letter, with the cleaned original. If every position matches, the text is a palindrome.
Palindrome formula
For a cleaned string S with length n, the text is a palindrome when:
S[i] = S[n β 1 β i], for every position i from 0 to n β 1.
In plain words: the first letter must match the last letter, the second must match the second-to-last, and so on toward the middle. Checking a string this way takes an amount of time proportional to its length, since both the cleaning step and the comparison step look at each character once.
Example
Take the sentence "A man, a plan, a canal: Panama."
- Clean it: fold the case and remove the punctuation and spaces. The result is
amanaplanacanalpanama. - Reverse the cleaned text:
amanaplanacanalpanama. - Compare the two strings. They match, so the sentence is a palindrome.
Accented text is handled the same way. "ΓtΓ©" (French for "summer") cleans to ete, because the accent on Γ is folded to a plain e. Reversing ete gives ete again, so it is a palindrome. The Spanish sentence "DΓ‘bale arroz a la zorra el abad" cleans to dabalearrozalazorraelabad, which also reads the same in reverse.
Examples of Palindromes
Words: racecar, level, radar, civic, kayak, noon, rotor, madam
Phrases: "A man, a plan, a canal: Panama", "Was it a car or a cat I saw?", "Never odd or even", "Do geese see God"
Numbers: 12321, 1001, 45654
Common Uses for Palindrome Checking
- Programming exercises. Palindrome checking combines string handling, loops, and conditional logic. It also raises edge cases such as empty input, single characters, mixed capitalization, and accented letters.
- Word play. Writers and puzzle makers build words, phrases, and numbers that read the same in both directions.
- Molecular biology. A palindromic sequence in DNA reads the same on both strands when each is read in the same chemical direction. Type II restriction enzymes have palindromic recognition sites and cut double-stranded DNA at those sequences.
A Short History of Palindromes
Palindromes appear across many cultures and centuries. The Sator Square, a Latin word square reading "SATOR AREPO TENET OPERA ROTAS", was found at Pompeii. The Pompeian copies date to before 79 CE, when the eruption of Vesuvius buried the city. The square reads the same in four directions: left to right, right to left, top to bottom, and bottom to top.
James Joyce used the word "tattarrattat" in his novel Ulysses for a knock at the door. It has 12 letters and reads the same in reverse.
Frequently Asked Questions
What is a palindrome?
A palindrome is a word, phrase, number, or sequence that reads the same forwards and backwards once spaces, punctuation, and capitalization are set aside.
Does this tool ignore spaces and punctuation?
Yes. The text is cleaned before comparison, so "A man, a plan, a canal: Panama" is recognized as a palindrome even though the raw sentence, with its commas and colon, is not identical in reverse.
Does it handle accented letters and other alphabets?
Yes. Accented letters are folded to their base letter, so Γ© becomes e, before comparison. Letters from any script are kept, not only the 26 letters of the English alphabet, so text in Greek, Cyrillic, Hebrew, or Chinese is cleaned and compared the same way as English text.
Are numbers checked as palindromes?
Yes. Digits are kept during cleaning, so numeric strings such as 12321 or 1001 are checked the same way as words.
Is a single letter a palindrome?
Yes. A single character reads the same forwards and backwards by definition, so both "a" and "I" count as palindromes.
What is the difference between a palindrome and an anagram?
A palindrome reads the same forwards and backwards, like "radar." An anagram rearranges the letters of one word or phrase to spell a different word, like "listen" and "silent." The two ideas are unrelated.
References
- Steven M. Carr, Memorial University of Newfoundland. Restriction Endonucleases. Restriction endonucleases β Type II restriction enzymes have palindromic recognition sites and make double-stranded cuts.
- Franco Benucci, University of Padua. Rotas Opera Tenet, Arepo Sator: un'interpretazione del 'quadrato magico' pompeiano (Atti dell'Istituto Veneto, 2007β08). Sator square study (PDF, Italian) β Pompeian copies of the palindromic square predate 79 CE.
- James Joyce. Ulysses (Project Gutenberg eBook #4300). Ulysses full text β "his tattarrattat at the door".