Boneyard Tools

How palindrome checking really works

Normalization, reversal by code point, and why ignoring case, spaces and punctuation turns a phrase into a palindrome.

Normalize first, then compare

A computer does not see 'A man, a plan, a canal: Panama' as a palindrome at all, because the raw characters, capital A at the front and lowercase a at the back, do not match. The trick is to normalize the text before comparing it. This tool lowercases the string when Ignore case is on, then strips everything that is not a letter or a number when Ignore punctuation is on. Only after that cleanup does it compare the string to its reverse. The Normalized text compared panel exists so you can see exactly what survived that process.

Reversing by code point, not by byte

Reversing a string sounds trivial, but a naive reverse can corrupt characters that are stored as more than one unit, such as many emoji and some CJK characters. To avoid that, the checker splits the text into whole Unicode code points, reverses that list, and rejoins it. This keeps every character intact, so a string ending in an emoji or an accented letter is mirrored cleanly rather than shattered into meaningless fragments. It also means a symmetric string of emoji is correctly recognized as a palindrome.

What each toggle actually changes

The three checkboxes decide how forgiving the comparison is. Ignore case folds capitals and lowercase together so 'Level' passes. Ignore punctuation keeps only letters and numbers, which is what lets full sentences with commas and colons count. Ignore spaces removes whitespace but keeps punctuation, and it only has an effect when Ignore punctuation is off, since punctuation removal already discards spaces. Turning all three off gives the strictest test, where the text must be a literal mirror image, character for character.

Famous palindromes and why they qualify

Classic phrase palindromes rely entirely on ignoring case, spaces and punctuation. 'Was it a car or a cat I saw?' becomes 'wasitacaroracatisaw', which reads identically in reverse. 'Never odd or even' collapses to 'neveroddoreven', and 'Madam, I'm Adam' becomes 'madamimadam'. None of these are palindromes as literally typed, since punctuation and capital letters break the symmetry. They only qualify once the text is normalized, which is exactly the default behaviour of this checker and why the cleaned string is worth reading.

Frequently asked questions

Is a single character always a palindrome?

Yes. A one-character string, and an empty string, are palindromes by definition because reversing them changes nothing. The same is true of any string that normalizes down to a single character or to nothing at all.

Why did my phrase fail even though it looks symmetric?

Check the Normalized text compared panel. A stray character, or a setting like Ignore punctuation being turned off, can leave a symbol in place that breaks the mirror. The cleaned string shows you precisely what was tested.