Palindrome Checker

A palindrome reads identically in both directions. This checker normalises your input - stripping punctuation, spaces and capitalisation - and compares it against its reverse, which is how phrase palindromes are conventionally judged.

Free · runs in your browser · updated

Input
Result
Start typing...

Palindrome Checker at a glance

What it does
Check whether a word, phrase or number reads the same backwards, ignoring punctuation, spaces and capitalisation. Instant and
Where it runs
Entirely in your browser — no data is uploaded
Works offline
Yes, once the page has loaded
Cost
Free, with no account and no usage limit

How to use the checker

  1. Enter a word, phrase, number or sentence.
  2. Read the verdict, along with the normalised form used for the comparison.
  3. Try a phrase - punctuation and spacing are ignored, so "A man, a plan, a canal: Panama" is recognised.

What counts, and what is ignored

For single words the test is exact: "level", "rotator", "deified". For phrases, the standard convention ignores spaces, punctuation and case, because otherwise almost no phrase would qualify.

Accents are the ambiguous case. Whether "é" should equal "e" depends on the language you are working in, and there is no universal answer.

InputResult
racecarPalindrome
A man, a plan, a canal: PanamaPalindrome once punctuation and case are ignored
Was it a car or a cat I saw?Palindrome
Never odd or evenPalindrome
12321Numeric palindrome
Hello worldNot a palindrome

Notable palindromes

"A man, a plan, a canal: Panama" - composed in 1948, about the Panama Canal. An extended version by Guy Steele runs to over 500 words.

"In girum imus nocte et consumimur igni" - a medieval Latin line, "we go in a circle at night and are consumed by fire", supposedly about moths.

The Sator Square - a Latin word square found at Pompeii that reads the same across, down, backwards and upwards. Nobody agrees what it was for.

"Do geese see God?" and "Madam, I'm Adam" - short enough to be genuinely elegant, which most long palindromes are not.

Finnish holds a record with saippuakivikauppias, a soapstone seller: nineteen letters, and a real word.

The interview question

Reversing a string and comparing is the obvious solution and is perfectly correct. The answer interviewers are usually looking for uses two pointers moving inward from each end, which stops at the first mismatch and uses no extra memory.

function isPalindrome(str) {
  const s = str.toLowerCase().replace(/[^a-z0-9]/g, '');
  let i = 0, j = s.length - 1;
  while (i < j) {
    if (s[i] !== s[j]) return false;
    i++; j--;
  }
  return true;
}

The details that separate a good answer from a passable one are the normalisation step, and knowing that JavaScript's split('').reverse().join('') breaks on emoji and other characters outside the basic plane, because it splits UTF-16 code units rather than characters.

Palindromes outside language

Dates. 22/02/2022 is a palindrome in day-month-year format, and these are rare enough to attract attention when they occur.

Numbers. Take any number, reverse it, add the two, and repeat: most numbers reach a palindrome quickly. 196 famously has not, after hundreds of millions of iterations, and nobody has proved it never will.

DNA. Palindromic sequences in genetics read the same on the complementary strand, and they are where restriction enzymes cut - the foundation of a great deal of molecular biology.

Music. A retrograde canon plays identically forwards and backwards. Haydn and Bach both wrote them.

How palindromes are actually written

Composing one is a constraint-satisfaction problem rather than a creative one, and the technique is consistent among people who do it.

You build outward from the centre rather than left to right, because every character you add at one end fixes a character at the other. The centre is usually a short pivot — a single letter, or a word that is itself symmetrical. From there each addition has to work simultaneously as forward text and as the reversal of what will follow.

This is why long palindromes read so strangely. The constraint is severe enough that meaning becomes secondary, and the results tend toward lists of loosely connected images. The genuinely admired ones are short, because at ten or fifteen letters it is still possible to say something.

Related forms relax the constraint: a semordnilap reads as a different word backwards ("stressed" and "desserts"), and a word-unit palindrome reverses words rather than letters, which allows far more natural sentences.

Why the interview question survives

Palindrome checking has been an interview staple for decades, which makes it a fair question about how someone thinks rather than what they know.

The naive answer — reverse and compare — is correct and gets partial credit. What distinguishes a stronger answer is noticing the details: that the input needs normalising before comparison, that the two-pointer approach exits at the first mismatch and allocates nothing, and that reversing a JavaScript string with split('').reverse().join('') corrupts emoji and other characters outside the basic multilingual plane, because it operates on UTF-16 code units rather than characters.

That last point is the interesting one, and it generalises well beyond this problem: almost every naive string operation in JavaScript has a Unicode edge case waiting in it.

Frequently asked questions

Yes, along with capitalisation. That is the standard convention for phrase palindromes - the alternative would disqualify nearly every well-known example.

Yes. 12321 and 1001 read the same in both directions. Palindromic dates and times are a related curiosity.

In Finnish, saippuakivikauppias at nineteen letters. In English, tattarrattat - a Joyce coinage for a knock at the door - and the more conventional rotator and redivider.

No. The check is a string comparison performed in your browser.

Nothing you enter here leaves your browser

Palindrome Checker does its work in JavaScript running on your own device. The page loads once, and after that there is no upload step and no server involved — which matters here because unpublished drafts, contracts and internal documents stay on your machine.

You can verify this rather than taking our word for it: load the page, disconnect from the internet, and the tool keeps working. Our privacy policy sets out what is and is not collected, and this guide explains why the distinction matters.