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

Case, whitespace, punctuation and diacritics can be toggled independently. Both the verdict and the pairwise comparisons use the normalised text, and lengths count Unicode code points (one emoji counts as one).

Normalisation options

2000 max

Result

Type some text to see the verdict

What this tool does

  • Check whether an English (or Chinese) sentence is a palindrome, with four toggles deciding what "palindrome" means here.
  • Find the longest palindromic substring for word games: centre expansion returns the contiguous fragment itself.
  • Get the longest palindromic subsequence length (skipping characters is allowed) from an O(n²) DP, for rough mirror-symmetry checks.

Example

Input

A man, a plan, a canal: Panama

Output

规范化:amanaplanacanalpanama
倒序:amanaplanacanalpanama
判断:是回文(长度 21,0 对不一致)
逐对比较:10 对
最长回文子串:amanaplanacanalpanama (21)
最长回文子序列长度:21

Real output with the default toggles (ignore case / whitespace / punctuation). Turning those three off keeps 30 code points, reports 13 mismatched pairs and flips the verdict to not a palindrome.

Frequently asked questions

What exactly counts as a palindrome here?

The text is first normalised according to the checkboxes (case, whitespace and punctuation are ignored by default; diacritics are kept unless you opt in), then compared pairwise from both ends: every pair must match. The rule is entirely driven by the toggles, and each compared pair is listed with its indices.

Do Chinese, digits and emoji count?

Yes. All indices and lengths count Unicode code points, so an emoji such as 🌊 counts as one and surrogate pairs are never split. Punctuation is the Unicode \p{P} category, so emoji-like symbols are not stripped. For example 你好🌊世界🌊好你 has 8 code points and only one mismatching pair (界/世).

What is the difference between the longest palindromic substring and subsequence?

A substring must be contiguous and is found by centre expansion in O(n²), returning the fragment and its start index. A subsequence may skip characters and uses an O(n²) DP that reports the length only. For bbbab the longest palindromic substring is bbb (length 3) while the longest palindromic subsequence has length 4 (bbbb).

Is there a length limit?

Yes: more than 2000 code points after normalisation is rejected with an error, because the subsequence DP is O(n²) and tens of thousands of characters would freeze the page. Anything up to 2000 code points is computed instantly.

Is my text uploaded?

No. Normalisation, pairwise comparison, longest palindromic substring and subsequence are all computed in your browser, with no network requests and nothing written to local storage.

Keywords:palindromepalindrome checkerlongest palindromepalindrome test

Related tools