Skip to content
UniKit

Palindrome checker

Check whether a string or sentence reads the same backwards: optionally ignore case, spaces, punctuation and diacritics, and get the normalised text, pairwise comparisons, the longest palindromic substring and the longest palindromic subsequence length.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Text to check

The verdict uses the normalised text; lengths and indices count Unicode code points so emoji are never split in half.

Normalisation rules

2000 max

Result

Type some text and it is checked immediately.

What this tool does

  • Verify a sentence that looks like a palindrome: strip the spaces and punctuation first, then compare the two ends instead of eyeballing it.
  • Practise or teach palindromic substrings — type babad and see that the longest palindromic substring is bab, next to the dynamic-programming subsequence length.
  • Check Chinese palindromes or strings containing emoji and confirm the tool counts Unicode code points rather than UTF-16 units.
  • Sanity-check symmetric identifiers: serial numbers or check digits designed to read the same backwards.

Example

Input

A man, a plan, a canal: Panama

Output

Palindrome · normalised amanaplanacanalpanama · 21 code points · longest palindromic substring amanaplanacanalpanama · longest palindromic subsequence 21

Case, spaces and punctuation are ignored by default, so the commas, colon and spaces in that sentence never take part in the comparison.

Frequently asked questions

Does ignoring punctuation also delete emoji?

No. Only Unicode punctuation (p{P} — commas, full stops, brackets and friends) is removed; emoji live in the symbol category p{S} and are still compared. So 😀ab😀 is a palindrome while 😀ab is not.

How are diacritics handled?

With the option enabled the text is decomposed with Unicode NFD and the combining marks are removed, turning café into cafe and über into uber. It is off by default because folding accents would merge letters that genuinely differ in French or German.

Do Chinese characters and digits work?

Yes. The comparison walks Unicode code points one by one, so Chinese, digits, kana and emoji all behave the same — 上海自来水来自海上 and 12321 are both palindromes. Ideographic spaces count as whitespace and disappear when that option is on.

Why is there a length limit?

The longest palindromic subsequence uses O(n²) dynamic programming and the longest substring uses O(n²) centre expansion, so tens of thousands of characters would freeze the tab. A single analysis is capped at 2000 code points and says so instead of pretending to work.

Is an empty string a palindrome?

Yes. When nothing survives normalisation the pair list is empty, the mismatch count is zero, and the tool reports a palindrome with a note — so pasting only punctuation is not mistaken for an error.

Keywords:palindromepalindrome checker回文检测回文串longest palindrome最长回文子串palindrome test镜像字符串中文回文emoji 回文

Related tools