Is it a palindrome?
Check whether text reads the same forwards and backwards. A palindrome is a word, number or phrase that is unchanged when reversed — level, racecar, 12321 — and with the matching options you can also catch full phrase palindromes that include spaces and punctuation. Useful for word games, coding puzzles, crosswords and curiosity.
How it works
The checker normalises your text, reverses it, and compares the two. Two optional rules control the normalisation:
if "ignore spaces and punctuation": keep only letters and numbers (\p{L}, \p{N})
if "ignore case": convert to lowercase
result = (cleaned text == reverse of cleaned text) and length > 0
Reversal is Unicode-aware — the string is split on full Unicode code points rather than
JavaScript’s native .split(''), so accented letters, emoji, and non-Latin scripts
reverse correctly rather than corrupting multi-byte sequences.
Example walk-through
Input: “A man, a plan, a canal: Panama” with both options enabled.
- Strip non-alphanumerics →
amanaplanacanalpanama - Lowercase → already lowercase
- Reverse character-by-character →
amanaplanacanalpanama - Cleaned text equals its reverse → Yes, it’s a palindrome
| Text | Case-sensitive | Ignore spaces/punct | Verdict |
|---|---|---|---|
| racecar | on | off | Yes |
| Race car | off (ignore) | on | Yes |
| hello | on | off | No |
| 12321 | — | off | Yes |
| ”Was it a car or a cat I saw?“ | off | on | Yes |
Practical uses
Word games and crosswords: checking an entry before committing it. Coding interviews: the palindrome problem is one of the most frequent string-manipulation questions — this lets you verify test cases instantly. Linguistics: researchers noting palindromic properties of words across languages. Number puzzles: testing numeric strings like dates (for example, 02/02/2020 in MMDDYYYY strips to 02022020, which reverses to 02022020 — a palindrome date).
Well-known palindromes to test
Here are canonical examples that exercise each option:
| Input | Options needed | Verdict |
|---|---|---|
racecar | none | Yes |
level | none | Yes |
A man, a plan, a canal: Panama | ignore case + punct | Yes |
Was it a car or a cat I saw? | ignore case + punct | Yes |
No lemon, no melon | ignore case + punct | Yes |
12321 | none | Yes |
hello | any | No |
Edge cases worth knowing
- An empty string returns “no” rather than a trivial yes, so you always get a meaningful result.
- A single character is always a palindrome — it reads the same in both directions by definition.
- With “ignore spaces and punctuation” disabled, a space is a real character, so
"a b a"is not a palindrome but"aba"is. - Numbers with leading zeros behave correctly — the comparison is on characters, not on numeric value.
- Accented characters like
éorñare supported through Unicode-aware reversal, so palindromes in French, Spanish, or other languages with diacritics work correctly.
The check runs entirely in your browser — nothing is uploaded.