
Palindrome / anagram checker
Check whether a text is a palindrome, and optionally an anagram of a second text. Runs entirely on your device, nothing is uploaded.
Palindrome / anagram checker reports whether a pasted text reads the same forwards and backwards, ignoring case, spaces and punctuation. Add a second text and it also checks whether the two share the same letters and digits, an anagram test. Comparison strips every character outside Unicode letters and digits first. Text with no letter or digit is refused.
Questions
How does it decide something is a palindrome?
It normalizes the text first: case is folded, accents are stripped through NFKD decomposition, and every character outside Unicode letters and digits is removed. What remains is compared to its own reverse. That means "A man, a plan, a canal: Panama" is treated as a palindrome, since the spaces, comma and colon never enter the comparison.
How does the anagram check work?
Only when compareTo is filled in. Both texts are normalized the same way as the palindrome check, then each is sorted character by character and the two sorted strings are compared for an exact match. Leave compareTo blank and only the palindrome result is reported.
What happens with an empty or symbol-only input?
It refuses with "give some text with at least one letter or digit", since normalization would otherwise leave nothing to compare and any verdict would be meaningless.
Does it check word order for the anagram test?
No. The whole text is normalized into one string of letters and digits and sorted, so word boundaries and word order play no part. Two texts with the same words in a different order, and even different word boundaries, can still match.
Does it work on non-Latin text?
The normalization strips marks from any script using Unicode combining characters, and keeps any Unicode letter or digit, so non-Latin scripts are compared too. It is a character-level comparison, not language aware, so accented and unaccented letters that decompose differently can compare unequal.