Solved.tools: Free Online Calculators & Tools

We use cookies for analytics and advertising. Learn more about our cookie policy

Palindrome Checker

Last updated: 27 June 2026

Reviewed by Gavin Meiring, Lead research and primary author ยท Doctoral Candidate (Corporate Governance) ยท Research and drafting assisted by AI

โœ…
Palindrome!
Checking: "racecar"
racecar
Was this helpful?


Palindrome Checker

A palindrome checker identifies whether a word, phrase, or sentence reads the same forwards and backwards. It is a useful tool for word game enthusiasts, puzzle makers, writers exploring wordplay, and teachers introducing the concept of palindromes to students.

How to Use the Palindrome Checker

  1. Type or paste the word or phrase you want to check into the input field.
  2. Choose whether to ignore spaces, punctuation, and capitalisation (most tools do this by default).
  3. Click the check button.
  4. The tool will display whether the input is a palindrome or not.
  5. If you entered a sentence, the result will typically show the cleaned version used for comparison.

The Formula

The algorithm strips the input of spaces and punctuation, converts all characters to the same case, then compares the resulting string to its reverse. In pseudocode:

  1. Remove all non-alphabetic characters and convert to lowercase.
  2. Reverse the cleaned string.
  3. Compare the original cleaned string to the reversed string.
  4. If they match, the input is a palindrome.

For example, the phrase "A man a plan a canal Panama" becomes "amanaplanacanalpanama" after cleaning, and reversing that string produces exactly "amanaplanacanalpanama". Because the two strings are identical, the phrase is confirmed as a palindrome.

Real-World Example

You are writing a quiz for a school activity and want to verify that "Was it a car or a cat I saw" is a genuine palindrome.

  1. Remove spaces and punctuation: "wasitacaroracatisaw"
  2. Reverse: "wasitacaroracatisaw"
  3. The strings match, so the phrase is confirmed as a palindrome.

You add it to the quiz with confidence.

Famous Palindromes Worth Knowing

Some of the most celebrated palindromes in English include "Madam, I'm Adam", "Never odd or even", and "Do geese see God". The longest known single-word palindromes include "racecar", "level", "civic", and "radar". Finnish has unusually long palindromic words, such as "saippuakivikauppias" (a lye soap dealer), which is often cited as the world's longest palindromic word in common use. Palindromic numbers, such as 121, 1331, and 12321, are also widely studied in mathematics.

Frequently Asked Questions

Does capitalisation matter when checking palindromes? By convention, palindromes are checked case-insensitively. The word "Madam" is treated as "madam" for comparison purposes. Most palindrome checkers apply this rule automatically.

Are spaces and punctuation included in the check? Standard palindrome checking ignores spaces and punctuation, treating only alphabetic characters. This means "A man, a plan, a canal: Panama!" qualifies as a palindrome even though it contains commas, a colon, and an exclamation mark.

Can numbers be palindromes? Yes. A number is a palindrome if it reads the same forwards and backwards, for example 121, 1001, or 9009. Some tools support numeric palindrome checking alongside text.

What is a word-unit palindrome? A word-unit palindrome is a sentence where the sequence of words, rather than letters, reads the same in both directions. For example, "First ladies rule the State and state the rule: ladies first."

What the cleaning step leaves behind

The formula section above says the input is stripped of everything but letters, converted to lower case, then compared against its own reverse. It is worth seeing what that does to a real phrase, because the cleaned string is the only thing the comparison ever sees. The tool shows it so you can check the input was read the way you expected.

Phrase enteredCleaned for comparisonLengthPalindrome
A man a plan a canal Panamaamanaplanacanalpanama21yes
Was it a car or a cat I sawwasitacaroracatisaw19yes
Madam, I'm Adammadamimadam11yes
Never odd or evenneveroddoreven14yes
Do geese see Goddogeeseseegod13yes
Rats live on no evil starratsliveonnoevilstar20yes
Step on no petssteponnopets12yes
No lemon, no melonnolemonnomelon14yes
Sums are not set as a test on Erasmussumsarenotsetasatestonerasmus29yes

The cleaned strings are what make phrases like "Madam, I'm Adam" count. The apostrophe goes, the capital M becomes a lower case m, and eleven letters remain. A tool that skipped the cleaning step would fail the phrase on the punctuation alone, which is why the convention exists.

Where a near miss fails, and why it fails early

A palindrome check is a character-by-character comparison from both ends at once. The moment two characters disagree, the answer is settled and the rest of the string does not need reading. That is why a single wrong letter near the end of a phrase shows up as a failure at the first comparison.

InputCleanedLengthFirst disagreement, from the leftFrom the right
A man a plan a canal Panamoamanaplanacanalpanamo21position 0position 20
Was it a car or a cat I waswasitacaroracatiwas19position 0position 18
Do geese see Godddogeeseseegodd14position 1position 12
Rats live on now evil starratsliveonnowevilstar21position 8position 12
Step on my petssteponmypets12position 4position 7

Positions are counted from zero. In the first row the last letter was changed from an a to an o, and the two ends stopped matching at once, because the check compares the first character against the last before it moves inward. In the fourth row the word "no" became "now", which added a letter in the middle and pushed the disagreement to position 8. That position is also the centre of the string, which is the signature of a length change rather than a substitution.

Letters only, or letters and digits

The page's formula says letters only, while the FAQ says numbers can be palindromes. Both are true, and a checker has to pick a rule. The two rules disagree on some inputs and on one class of input they disagree badly.

InputLetters and digitsPalindrome under that ruleLetters onlyPalindrome under that rule
121121yesnothing leftyes
12.211221yesnothing leftyes
1234565432112345654321yesnothing leftyes
4x44x4yesxyes
90099009yesnothing leftyes
A1B2B1Aa1b2b1ayesabbayes
1a2b3b2a11a2b3b2a1yesabbayes
A1BCB2Aa1bcb2anoabcbayes
AB12BAab12banoabbayes

Three rows in that table are worth reading twice. The pure number rows and 4x4 leave nothing or almost nothing behind under the letters-only rule, and an empty string is a palindrome by definition, so those inputs pass for a reason that has nothing to do with the input. A checker that accepts an empty cleaned string will report "yes" for a row of full stops. The last two rows are the genuine divergence: strip the digits from A1BCB2A and you get abcba, a clean palindrome, while keeping the digits gives a1bcb2a, which is not. The same input can be a palindrome or not depending on the rule, so the tool's behaviour on your input is worth checking before you rely on the answer.

How many palindromic numbers exist

Numbers are palindromes when they read the same in both directions, and counting them shows how sparse they become as the numbers grow. Palindromes are determined entirely by their first half, so the count grows by a factor of ten every two digits rather than every digit.

DigitsPalindromic numbers in the rangeShare of the range
19100%
2910%
39010%
4901%
59001%
69000.1%
79,0000.1%

The one-digit row is every number from 1 to 9, so all of them qualify. From there the share falls by a factor of ten every two digits, which is why palindromic numbers feel common among small values and rare among large ones. There are exactly 90 three-digit palindromes and exactly 90 four-digit ones.

The reverse and add process

A related exercise takes a number, adds it to its own reverse, and repeats until the sum is a palindrome. Most numbers converge quickly, and the number of steps is a fact you can reproduce by hand.

StartStepsPalindrome reached
192121
392363
5931111
6944884
79644044
89248813200023188

Some numbers resist. Running the process from 196 for 300 steps produced no palindrome, and the value had grown to 133 digits by the end. The first steps are short enough to check on paper: 196 to 887, then 1675, then 7436, then 13783, then 52514, then 94039, then 187088. The process from 295 and from 394 joins the same sequence at 887, so all three share the same fate. Whether the sequence from 196 ever reaches a palindrome is an open question, which is why 196 is the smallest of the numbers known as Lychrel candidates.

The check on the page's own quiz phrase

The quiz phrase used in the example above is "Was it a car or a cat I saw". Removing the spaces gives wasitacaroracatisaw, which is nineteen characters long. Reversing that string produces wasitacaroracatisaw exactly, so the phrase is a palindrome and the quiz answer key is correct. Nineteen is odd, so the string has a true centre character: the o in "or", sitting at position 9 of 19 when the count starts at zero. The nine characters before it mirror the nine after it. As a check on the tool: enter the phrase with the last word changed to "was" and the tool should report no, with the cleaned string wasitacaroracatiwas, which differs from its reverse at both ends.


Also try these free tools: