Palindrome Checker

Enter a word or phrase to see whether it reads the same forwards and backwards, along with the cleaned and reversed text used for the comparison.

At a glance

A palindrome is a word, phrase or number that reads the same forwards and backwards. People check for them in word games, coding exercises, name and brand brainstorming, and number puzzles. This checker removes spaces, punctuation and capitalization, reverses what is left, and compares it with the original. Because it also shows the cleaned text, the reversed text and the first place where the two disagree, you can see exactly why an input passes or fails instead of just getting a yes or no.

How the check works

  1. The text is normalized to Unicode NFC form, so a letter typed as a base letter plus a separate accent mark is treated as one accented letter.
  2. Everything is converted to lowercase.
  3. Only letters (from any writing system) and digits are kept; spaces, punctuation, symbols and emoji are deleted.
  4. The remaining characters are reversed and compared with the original sequence. If they are identical, the input is a palindrome.

With n characters you only need to compare mirrored pairs: the first with the last, the second with the second to last, and so on. The middle character of an odd-length string needs no partner. In "racecar" the pairs r-r, a-a and c-c settle it, and the e in the middle is skipped. The "first difference" line in the result box walks through this same comparison from the outside in, so you can see which pair broke the pattern.

Sample inputs, checked by the same function

The table is calculated when the page is built, using the same cleaning and comparison rules as the tool above.

InputCleaned textLengthReversedResult
levellevel5levelPalindrome
Never odd or evenneveroddoreven14neveroddorevenPalindrome
A man, a plan, a canal: Panamaamanaplanacanalpanama21amanaplanacanalpanamaPalindrome
Was it a car or a cat I saw?wasitacaroracatisaw19wasitacaroracatisawPalindrome
Madam, I'm Adammadamimadam11madamimadamPalindrome
No lemon, no melonnolemonnomelon14nolemonnomelonPalindrome
1232112321512321Palindrome
Étéété3étéPalindrome
Hello, Worldhelloworld10dlrowollehNot a palindrome
palindromepalindrome10emordnilapNot a palindrome

"Madam, I'm Adam" shows why punctuation has to go: with the apostrophe and comma removed, the letters read madamimadam in both directions. The rule also matters: if you kept the spaces and compared character by character, "Never odd or even" would fail because its spaces sit in different places when reversed. When you share a palindrome, it helps to say which convention you are using.

How many palindromic numbers are there?

For a d-digit number, the first half (rounded up) decides everything, because the second half is just its mirror image. The leading digit has 9 choices (1 to 9) and each other digit in the first half has 10, so the count is 9 x 10ceil(d/2) - 1. The table compares that formula with a check of every number of that length.

DigitsFormula 9 x 10^(ceil(d/2) - 1)Checked one by one
199
299
39090
49090
5900900

Numbers with 2k digits and numbers with 2k - 1 digits therefore come in equal counts, because the middle digit of the odd-length numbers is a free choice that the mirror does not need to copy. Single-digit numbers are palindromes by definition.

A checked calculation: reverse and add

Take a number, add its reversal, and repeat; many numbers turn into a palindrome quickly. Starting from 56 the path is 56 → 121, which takes 1 step. Starting from 89 it takes 24 steps and only reaches a palindrome at 8813200023188. Whether every number eventually becomes a palindrome this way in base 10 is not proven, and 196 is the best-known candidate for one that never does. You can paste the intermediate values into the checker to watch the process.

Notes for writing your own checker

The algorithm is the easy part. The mistakes usually come from preprocessing. If you skip lowercasing, "Level" fails; if you do not strip spaces and punctuation, no sentence will ever match. Another trap is that one visible character can occupy more than one code unit, so reversing a string naively can split such a character apart. This tool works on an array of whole characters, which avoids that. It also normalizes accents so that "é" typed as one character or as e plus a combining accent is treated alike. The running time is linear in the length of the text, and comparing only mirrored pairs means about n / 2 comparisons.

Limits and common surprises

Putting the result to use

When the answer is "not a palindrome", read the first-difference line: it names the pair of characters that disagree, which is where to edit. To build your own, start from the middle and extend outward with the same letter on both sides. For coding practice, the two-pointer approach (compare from both ends toward the center) avoids building a reversed copy and uses less memory. To count the characters in your text, use theWord Counter, and to change capitalization first, the Text Case Converter.

Related tools

Frequently Asked Questions

Can numbers be checked as palindromes too?

Yes. An input made only of digits, such as 12321, is checked in the same way, and so are mixed inputs of letters and digits.

Does a sentence with spaces or punctuation stop it from being a palindrome?

No. Spaces, punctuation and capitalization are removed before the comparison, so "A man, a plan, a canal: Panama" is recognized even though the raw text is not symmetric.

What happens if I enter just one character?

A single character reads the same in both directions, so it is reported as a palindrome. It is technically correct but not a meaningful word game.

Does the checker treat é and e as the same letter?

No. Accented letters stay as they are, so "été" is a palindrome (é, t, é) while "éte" is not. Only the encoding is normalized, so an accent typed as a separate mark is combined with its letter first.

Does it work for languages other than English?

Yes, letters from other writing systems such as Cyrillic, Greek, kana and Chinese characters are kept and compared one character at a time. The comparison follows the written characters, not how the words are pronounced.