Palindrome Checker - Words, Phrases and Numbers, with the Longest Palindrome Inside

A palindrome reads the same forwards and backwards. Type a word or a whole phrase and this checker shows the cleaned text, its reverse and, if it fails, the first place where the two disagree.

About this tool

It can also find the longest palindrome hidden inside any text and check numbers in decimal, binary, octal or hexadecimal. Everything runs in your browser.

How it works

For phrases the usual rule is to ignore capital letters, spaces and punctuation, so A man, a plan, a canal: Panama counts. The tool cleans your text with the options you choose (all three are shown as switches), cuts it into characters and compares the first with the last, the second with the second last and so on to the middle. If a pair differs it stops there, highlights both characters and says which position failed. The 21 letters of amanaplanacanalpanama are the same reversed, so that phrase passes.

Characters are counted the way a reader sees them. Where the browser has Intl.Segmenter, a letter with a separate accent mark or an emoji built from several parts is one character (a grapheme cluster, Unicode Standard Annex #29); without it the tool counts code points and says so. Emoji and other symbols are ignored along with punctuation unless you switch that option off. Accent folding is off by default, so e and é are different. Turn on the accent switch and the text is normalised with NFKD and the combining marks are removed first, which makes the French line Ésope reste ici et se repose a palindrome.

The longest palindromic substring is found with Manacher's algorithm (Glenn Manacher, 1975), which finds the palindromes around every centre in one linear pass. In babad it is bab, and in forgeeksskeegfor it is geeksskeeg. When two palindromes are equally long, the leftmost is shown. It runs on the cleaned text, so spaces and punctuation are ignored there as well.

A palindromic number reads the same reversed, and whether a number is one depends on the base it is written in. 585 is a palindrome in decimal (585), in binary (1001001001) and in octal (1111), but not in hexadecimal (249). Numbers are handled as exact big integers, up to 300 digits, and the tool also gives the next palindromic number above the one you typed. Negative numbers and decimals are refused with a message, because palindromic numbers are non-negative whole numbers.

Worked examples

A man, a plan, a canal: Panama

With the default options the compared text is amanaplanacanalpanama, 21 letters, and it equals its reverse, so the answer is yes. The line is credited to Leigh Mercer, published in Notes and Queries in 1948.

Was it a car or a cat I saw?

The compared text is wasitacaroracatisaw, 19 letters, and it reads the same both ways. The question mark and the spaces are ignored. Switch off Ignore spaces, punctuation and symbols and it fails at once, because the first character, w, does not match the last, ?.

Hello

The compared text hello reversed is olleh. The first character from the start (h) does not match the first from the end (o), so the first mismatch is at position 1.

A number in several bases

12321 is a palindromic number. 585 is a palindrome in binary, octal and decimal but not in hexadecimal, where it is 249. The next palindromic number after 12321 is 12421.

Frequently asked questions

What is a palindrome?

A word, phrase, number or other sequence that reads the same forwards and backwards. The word comes from the Greek palin (again) and dromos (way, direction). Examples are level, madam and the number 12321.

Do spaces, punctuation and capital letters count?

Normally not: Wikipedia notes that punctuation, capitalisation and spaces are usually ignored. This checker ignores case, spaces, punctuation and symbols by default, and each can be switched off for a stricter test. With all of them off, Madam, I'm Adam fails, but madamimadam passes.

Is a single letter or digit a palindrome?

Yes. A single character is the same reversed, and Wikipedia states that all one-digit numbers are palindromic. An empty text is not a palindrome here: if nothing is left after the options are applied, the tool tells you there is nothing to compare.

How do I check if a number is a palindrome?

Write its digits and read them backwards. 12321 reversed is 12321, so it is one; 12345 reversed is 54321, so it is not. Use the Number mode to check it in decimal, binary, octal or hexadecimal, and to see the next palindromic number.

What is the longest palindromic substring?

The longest run of characters inside a text that is itself a palindrome. In racecar the whole word is one. In babad it is bab, and aba is just as long; the leftmost, bab, is shown. The tool computes it with Manacher's algorithm on the cleaned text.

Does it work for accented letters, emoji and other languages?

Yes, with a caveat. Text is compared as whole characters, so a letter with a separate accent mark is one character where the browser supports Intl.Segmenter. Accents are kept by default; the accent switch folds é to e. Right-to-left and complex scripts are compared character by character in the order they are stored, which is not always how a reader judges them.

Why can a number be a palindrome in one base and not another?

The digits change with the base. 585 is 1001001001 in binary, which is symmetrical, but 249 in hexadecimal, which is not. A number smaller than the base is a single digit and so a palindrome in that base.

Is my text sent anywhere?

No. The check runs in your browser and nothing you type is uploaded.

Updated Oct 13, 2026