PalindromeQ[list]
returns True if the given list is identical to Reverse[list], and False otherwise.
PalindromeQ[n]
returns True if the integer n is identical to IntegerReverse[n], and False otherwise.
PalindromeQ[string]
returns True if the given string is identical to StringReverse[string], and False otherwise.
PalindromeQ
PalindromeQ[list]
returns True if the given list is identical to Reverse[list], and False otherwise.
PalindromeQ[n]
returns True if the integer n is identical to IntegerReverse[n], and False otherwise.
PalindromeQ[string]
returns True if the given string is identical to StringReverse[string], and False otherwise.
Details and Options
- Possible options of PalindromeQ are:
-
IgnoreCase False whether lowercase and uppercase letters should be treated as equivalent IgnoreDiacritics False whether diacritics should be ignored Language $Language what language or alphabet to assume
Examples
open all close allBasic Examples (3)
PalindromeQ["rotator"]Check the palindromic property with its list of characters:
PalindromeQ[Characters["rotator"]]PalindromeQ[12321]PalindromeQ[001232100]Search for palindromic primes:
Select[Array[Prime, 100], PalindromeQ]Scope (3)
These are English palindromic words:
PalindromeQ /@ {"madam", "tenet", "redder", "racecar"}These are palindromic decimal integers:
PalindromeQ /@ {12321, 3883, 100001}These lists remain invariant under reversal:
PalindromeQ[{a, b, b, a}]PalindromeQ[{"a", "b", "b", "a"}]Generalizations & Extensions (1)
To find palindromic sentences, remove whitespace and punctuation characters:
sentence = "Now, sir, a war is won!";PalindromeQ[sentence]StringReplace[sentence, WhitespaceCharacter -> ""]StringReplace[%, PunctuationCharacter -> ""]PalindromeQ[%, IgnoreCase -> True]Options (3)
IgnoreCase (1)
By default, lowercase and uppercase letters are considered different:
PalindromeQ["Anna"]Use IgnoreCase->True to treat them as equivalent:
PalindromeQ["Anna", IgnoreCase -> True]IgnoreDiacritics (1)
Language (1)
Removal of diacritic marks depends on the choice of language:
PalindromeQ["añana", IgnoreDiacritics -> True, Language -> "English"]PalindromeQ["añana", IgnoreDiacritics -> True, Language -> "Spanish"]RemoveDiacritics["añana", Language -> "English"]RemoveDiacritics["añana", Language -> "Spanish"]Applications (4)
Tetradic numbers remain invariant when flipped back to front and up-down. Hence they only contain digits 0, 1, 8. These are all tetradic numbers with up to five digits:
Select[FromDigits /@ Tuples[{0, 1, 8}, 5], PalindromeQ]Select[%, PrimeQ]It is conjectured that this algorithm eventually produces a palindromic number for every decimal input:
algorithm[n_] := NestWhile[# + IntegerReverse[#]&, n, Not[PalindromeQ[#]]&]algorithm[48]algorithm[89]PalindromeQ[%]There are numbers for which it is not known whether the algorithm succeeds, the smallest being 196:
TimeConstrained[algorithm[196], 1]Find the palindromic Roman numerals up to 1000:
Select[RomanNumeral[Range[1000]], PalindromeQ]Find the longest palindromic word in French:
MaximalBy[Select[WordList[Language -> "French"], PalindromeQ], StringLength]Properties & Relations (3)
The empty list is considered a palindrome:
PalindromeQ[{}]The null string is considered a palindrome:
PalindromeQ[""]One-digit decimal numbers are considered palindromes:
PalindromeQ[2]By default, a string is considered palindromic if its list of characters is palindromic:
PalindromeQ["madam"]PalindromeQ[Characters["madam"]]The first nine coefficients of this series expansion are special palindromic numbers:
Series[-(10x + 1) / ((x - 1)(10x - 1)(100x - 1)), {x, 0, 8}]coeffs = CoefficientList[%, x]PalindromeQ /@ coeffsThose coefficients can also be generated as squares of repunits 1, 11, 111, etc.:
coeffs === Table[FromDigits[Table[1, n]] ^ 2, {n, 1, 9}]See Also
Related Guides
Text
Wolfram Research (2015), PalindromeQ, Wolfram Language function, https://reference.wolfram.com/language/ref/PalindromeQ.html (updated 2016).
CMS
Wolfram Language. 2015. "PalindromeQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/PalindromeQ.html.
APA
Wolfram Language. (2015). PalindromeQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PalindromeQ.html
BibTeX
@misc{reference.wolfram_2026_palindromeq, author="Wolfram Research", title="{PalindromeQ}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/PalindromeQ.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_palindromeq, organization={Wolfram Research}, title={PalindromeQ}, year={2016}, url={https://reference.wolfram.com/language/ref/PalindromeQ.html}, note=[Accessed: 13-June-2026]}