Palindrome Checker
Check a word or phrase for palindrome: optionally ignore spaces, punctuation and case. Examples, algorithm walkthrough and common mistakes.
Why bother checking whether a text is a palindrome
A palindrome is a string that reads the same from left to right and from right to left. "Level", "rotor", "never odd or even", the phrase "A man, a plan, a canal: Panama" - all of them are palindromes. The check takes a second, and it answers a question that otherwise forces you to flip the word over in your head. The task comes up wherever wording matters: wordplay in a headline, a name for a project or a brand, checking a number, or looking at a line of code that refuses to behave. There is one more plot worth mentioning: puzzles and quests where a palindrome hides the answer, and school assignments where you have to write the algorithm and then read someone else's solution.
What the checker does
- Three independent switches: ignore spaces, punctuation and case
- Reports the first mismatch and the positions of the characters that differ
- Shows the normalized text that was actually compared
- Handles Cyrillic, Latin and any other Unicode letters
- Five ready-made examples one click away, including a phrase from the classics
How to check a phrase
- Paste the word or phrase into the field
- Tick what should be ignored: spaces, punctuation, case
- Press "Check for palindrome" and read the result
- If a mismatch is reported, look at the position and the two characters that differ
How the check works
The string is first normalized according to the rules you picked, then compared from both ends inward: one pointer starts at the first character, the other at the last, the characters under them are compared at every step, and as soon as they differ the search stops. If the pointers meet without finding a mismatch, the string is symmetric. The algorithm is linear, it makes a single pass and never copies the text, so checking a long document costs no more than reading it once. Pay attention to the normalization step, because that is where most of the arguments about whether something counts as a palindrome come from.
Examples: what is a palindrome and what is not
| Text | Result | Notes |
|---|---|---|
| level | palindrome | three letters with mirrored ends |
| rotor | palindrome | symmetrical without any settings |
| radar | palindrome | the classic English example |
| never odd or even | palindrome | needs space and case normalization |
| A man, a plan, a canal: Panama | palindrome | punctuation has to go |
| Was it a car or a cat I saw | palindrome | classic punctuation-heavy line |
| racecar | palindrome | same rule, same result |
| abc | not a palindrome | reversed it reads cba |
| palindrome | not a palindrome | the word does not equal its reverse |
| 121 and 12321 | palindrome | numbers obey the same rules |
Where palindromes actually turn up
The best-known group of palindromes is the set of Russian phrases invented in the nineteenth century. "A rose fell on the lap of Azor" became the model of the genre: long, rhythmic, and unforgiving about letters and spaces. Nineteenth-century writers treated the genre as a failure, on the grounds that Russian simply could not produce one. They were half right: long Russian palindromes are nearly impossible without normalization, but with it they appear at once.
Palindromes live in engineering too. A palindromic DNA stretch is reverse-complementary to itself and serves as the point where replication restarts. In programming you run into palindromic patterns, numbers and strings, and in data analysis people look for them to understand the shape of a sequence. Vehicle registration numbers and phone numbers are a separate case: a symmetrical number looks tidier, and people pick it on purpose.
There are everyday uses that involve no science at all. A project name that reads the same from both ends is easier to remember. A riddle whose answer hides in a palindrome works on any audience. A barcode or an article number typed symmetrically is quicker to check by eye while someone is standing in a queue. The quickest way to try any of that is to use the example buttons under the form and watch them land in the input field.
- Long phrases like "step on no pets" or "no lemon, no melon"
- Names and handles you want to read from either end
- Palindromic DNA stretches in bioinformatics
- Symmetrical phone numbers and plate numbers
- Palindromes in computer science assignments and contests
- Puzzles and rebuses where the answer is hidden symmetrically
Why a palindrome does not always read the same
The main source of confusion is that normalization changes the very thing being checked. The string "Dovod dovod" contains a space, so a character-by-character comparison rejects it. Drop the space and you get "dovoddovod", and that is a palindrome. Formally you are looking at two different answers to one question, and which one is right depends on who is asking.
The second trap has to do with alphabets. Comparison is character-based, so "A" and "a" are different characters, and in Russian "yo" and "e" are different letters. A palindrome can fall apart over a single yo, and people rarely notice it by eye. If exact wording matters, keep the case rule on and run the check a second time with it off, so you know what the result actually rests on.
The third mistake is about language. An Arabic string read from right to left gives a different answer than a machine comparison going left to right. Arabic palindromes have traditionally been written and read in that direction, and the same text in Latin script looks different. This matters for signs, embroidery and inscriptions, where the reading direction is set by a person rather than by an algorithm.
- A space inside a phrase breaks symmetry under a strict comparison
- Case and the letter yo quietly wreck symmetry
- Reading direction for Arabic and Hebrew inscriptions
- An empty string is not a palindrome even though the algorithm will not reject it
- One symmetric word does not make the whole sentence symmetric
- A string of digits follows exactly the same rules
Walking through the algorithm on real examples
The algorithm keeps two pointers: one at the start of the string, one at the end. At each step the characters under them are compared, and once they differ there is no point in continuing, because that first mismatching pair already disproves the palindrome. If they match, both pointers move toward the centre. When they meet without finding a mismatch, the string is symmetric.
Walking through it this way shows where the answer comes from. The table below marks the exact position where the characters stopped agreeing. That position is the shortest stretch that makes the string fail, and everything before it does match. This is the level of detail you need when you have to explain a solution in a computer science class, not just print the verdict.
What happens at each step
| Step | Action | Outcome |
|---|---|---|
| 1 | Normalization | Spaces, punctuation and case are removed as requested |
| 2 | Pointers at the edges | Left on the first character, right on the last |
| 3 | Comparison | The characters under the pointers are matched |
| 4 | Mismatch | The position of the first difference is recorded |
| 5 | Shift | Pointers move inward while the characters agree |
| 6 | Meeting | The pointers met, so the string is symmetric |
| 7 | Empty input | No verdict is shown, some text is required |
| 8 | Re-run | Changing a setting recalculates the result |
The check makes a single pass over the string, so long text does not slow the tool down.
Palindromes in numbers, in code and on labels
Numeric palindromes are easy to spot by eye: 121, 12321, 45654. There is arithmetic structure behind them too: the more digits a number has, the more of them qualify, and from five digits upwards there are dozens per hundred. That is why palindromes show up in brute-force exercises and in contest problems about divisibility, where the shape of the number gives you the idea.
In code, palindromes turn up as coincidences, and they are regularly spotted in logs, test fixtures and generated identifiers. When you run across one, look at the surroundings first: spaces, dashes and letter case explain most findings. It also helps to know how numbers behave in other bases, and for that there is a number base converter plus a longer piece on the binary code.
- Numbers: 121, 12321, 45654, recognizable without any algorithm
- Code and logs: unexpected symmetry usually comes from formatting
- Article numbers and barcodes: checkable by eye, without a program
- Names and handles: readable from both ends saves the explaining
- Random strings: if there is a match, run it again without normalization
Frequently asked questions
What counts as a palindrome
How is a palindrome different from a reversed string
What should I do about spaces and punctuation
Is a single letter a palindrome
Are there Russian palindrome words
Can a palindrome be found inside a large text
Does this help with phone numbers and plate numbers
Where else is knowing about palindromes useful
Related articles
Palindrome: What It Is, Palindrome Words and How to Check Your Own
What a palindrome is, how the strict definition differs from normalization, Russian and English palindrome words, a step-by-end check, Manacher algorithm, palindromic numbers and DNA.
Flip Text: Backwards, Upside Down and Mirrored
Three different kinds of flipped text: reversing characters, turning letters upside down with Unicode lookalikes, and mirroring. The substitution table, why emoji and flags break, how to read flipped text back, and where each variant is used.
Related tools
Sort Lines
Sort lines alphabetically, numerically, by length, or randomize with duplicate removal option
Text Truncator
Truncate text to a specified number of characters or words with optional ellipsis
Lorem Ipsum Generator
Generate lorem ipsum placeholder text by paragraphs, sentences, or words
Slug Generator
Convert text to URL-friendly slug with customizable separator, case, and stop word options
Remove Spaces
Remove leading/trailing spaces, extra spaces, all spaces, and blank lines from text
Text to Emoji
Convert text to emoji representations using regional indicators and keycaps
Emoji Picker & Search
Search and browse emojis by category with click-to-copy and recently used history
Text Wrap / Unwrap
Wrap text at specified column width or unwrap joined lines back into paragraphs