Anagram Checker: How to Tell If Two Phrases Are Anagrams

Contents
- Why it's confusing: you can't confirm an anagram by eye
- A 4-step manual check without a tool
- Core technical mechanism: anagram-checking algorithms and Unicode jamo decomposition
- Algorithm performance comparison by anagram-checking method
- 5 common mistakes when checking for anagrams
- A 5-step workflow for checking anagrams accurately
- 7 tips for checking anagrams
- Final decision tree: are the two phrases anagrams?
- Cheat Sheet: Key Terms for Anagrams and Text Puzzles
- Frequently Asked Questions
You can't really be sure whether two words or phrases are anagrams (a letter-rearranging word game) just by glancing at them. The exact answer takes about a second: remove uppercase/lowercase differences, spaces, and punctuation, sort the remaining letters alphabetically, and compare. You can also compare letter counts.
Even a heavily scrambled sentence can be checked perfectly with a letter-decomposition algorithm, like the famous Harry Potter reveal "Tom Marvolo Riddle ➔ I am Lord Voldemort."
Key takeaways ① Checking for an anagram means removing letter case, spaces, and punctuation, then verifying that the remaining letters have exactly the same makeup and frequency. ② 'listen' and 'silent', or 'rail safety' and 'fairy tales', can have different spacing or word counts and still be perfect anagrams if their sorted strings match. ③ For Hangul, you can check Korean anagrams not only by precomposed syllables (such as the syllable “ga”) but also by decomposing Unicode into initial consonants, medial vowels, and final consonants.
Why it's confusing: you can't confirm an anagram by eye
Online escape room games, mystery novels, and cipher puzzles often hide a hint phrase as an anagram of the answer word. Suppose you get 'rail safety' as a hint and 'fairy tales' is an answer candidate. You need to confirm whether the two phrases are really anagrams before you can move to the next step.
The problem is that once a phrase gets past 10 to 20 characters, it's easy to lose your place or miscount while checking repeated letters by eye (how many a's, how many l's). Different spacing and word counts make it even more confusing.
A 4-step manual check without a tool
You can check any pair by hand accurately if you follow these four steps in order.
- Normalize to lowercase: Convert every letter in both phrases to lowercase.
- Remove punctuation and spaces: Delete all spaces, commas, periods, apostrophes ('), and hyphens (-), leaving only letters and digits.
- Sort A–Z: Sort the remaining characters in alphabetical order.
- Compare the strings 1:1: If the two sorted strings match down to the last character, the phrases are anagrams.
Common anagram examples
- Single word: 'Listen' vs 'Silent' ➔ Sorted result: both are 'eilnst' (match!)
- Phrase: 'rail safety' vs 'fairy tales' ➔ After removing spaces and sorting: both are 'aaefilrsty' (match!)
- Famous literary example: 'Tom Marvolo Riddle' vs 'I am Lord Voldemort' ➔ Sorted: 'adeillmmooorrtv' (match!)
Free · No installation · Just enter two phrases and see in one second whether they are anagrams

Core technical mechanism: anagram-checking algorithms and Unicode jamo decomposition
Here are the two core algorithms that let a computer check an anagram in 0.001 seconds.
1. Hash table frequency counting (Time: O(N), Space: O(1))
- Create an integer array of size 26 (or a hash map).
- Loop through the first string and increment the count for each letter by 1.
- Loop through the second string and decrement the count for each letter by 1.
- Finally, check that every element in the array is exactly 0.
- Even if the strings are millions of characters long, this method finishes the check in a single pass (Linear Time).
2. Hangul Unicode initial, medial, and final jamo decomposition
Hangul is stored as precomposed syllable Unicode (U+AC00 to U+D7A3), so to check an anagram at the jamo level, you need to decompose it with the Unicode formula:
- Unicode = (initial × 588) + (medial × 28) + final + 44032
- After decomposing into initials (19), medials (21), and finals (28), compare the frequencies of consonants and vowels. That lets you check for perfect jamo anagrams between Hangul sentences.
Algorithm performance comparison by anagram-checking method
| Method | Time complexity (Time) | Space complexity (Space) | Best data size |
|---|---|---|---|
| Brute-force nested loops | O(N²) | O(1) | Very short words under 100 characters |
| Sort and compare | O(N log N) | O(N) | Everyday sentences up to a few thousand characters (simple to implement) |
| Hash table counting | O(N) (optimal) | O(1) (fixed at 26) | Large texts with millions of characters, real-time checks |
| Prime product hashing | O(N) | O(1) | Short English words (watch for overflow) |
5 common mistakes when checking for anagrams
- Treating uppercase and lowercase as different letters: Comparing 'Apple' and 'pale' without converting case and wrongly calling it a mismatch.
- Leaving punctuation or spaces in: Sorting with commas (,), periods (.), or spaces included, which changes the length.
- Ignoring letter counts (multiplicity): Looking only at which letters appear in 'look' and 'lock' and missing that 'o' appears twice in one and once in the other.
- Counting two identical words as anagrams: Many quiz rules do not accept 'test' and 'test' as true anagrams because the order never changes.
- Comparing only precomposed Hangul syllables: The words hakgyo (“school”) and gyohak (“study”) are anagrams at the syllable level, but this misses the richer jamo-level anagrams that are possible.
A 5-step workflow for checking anagrams accurately
- Step 1 (prepare the two phrases): Get the original text and the scrambled hint phrase.
- Step 2 (paste into the tool's fields): Enter each phrase in the Text 1 and Text 2 fields.
- Step 3 (automatic real-time normalization): The tool automatically handles spaces, commas, and letter case, then sorts the letters.
- Step 4 (check the match and letter counts): Within 0.1 seconds, look for the green “Anagram match” notice on screen.
- Step 5 (analyze differences if there is no match): If the phrases are not anagrams, check the letter list to see which letters are missing or extra.
7 tips for checking anagrams
- Prime-number hashing: Give each of the 26 letters a unique prime (A=2, B=3, C=5, and so on) and multiply them. The product is the same no matter the order.
- English anagram shortcut: If a word has a suffix such as -ing, -ed, or -er, strip it first and compare the roots. This is much faster.
- Create pen names with anagrammatizing: Famous authors rearrange the letters of their real names to make secret pseudonyms.
- How it differs from a palindrome: A palindrome reads the same backward, like 'level' or 'racecar'. It is a special subset of anagrams.
- Use with Scrabble: Use an anagram dictionary to find the highest-scoring word you can make from your 7 tiles.
- Sub-anagrams: These are also useful when you want to analyze partial words made from only some of the letters in the original word.
- Password hint encryption: Setting an anagram of an easy-to-remember sentence as a password hint can greatly improve security.
Final decision tree: are the two phrases anagrams?
- Result A (same sorted result after removing spaces and punctuation) ➔ Perfect anagram (True Anagram)
- Result B (same letters and the original order is also unchanged) ➔ Identical word (Trivial Match)
- Result C (one or two letters have different counts) ➔ Not an anagram (Partial Match)
- Result D (completely different letter makeup) ➔ Not an anagram (No Match)
Cheat Sheet: Key Terms for Anagrams and Text Puzzles
- Anagram: A word puzzle where you rearrange the letters of a word or phrase to form a different word or phrase with a different meaning.
- Anagram dictionary: A database that groups all words with the same letters, using the sorted letters (the signature) as the key.
- Pangram: A sentence that uses all 26 letters of the alphabet at least once (for example, the quick brown fox jumps over the lazy dog).
- Palindrome: A word or phrase that reads the same forward and backward.
Frequently Asked Questions
Do word spacing and word count matter when checking for an anagram?
No. Anagram checks ignore spaces, commas, periods, and other punctuation completely. Only the letters and digits themselves — their makeup and their counts — are compared, so a pair that differs in spacing still counts as a perfect anagram.
Can you check anagrams for non-English words, such as Korean?
Yes, not just English. The tool also supports Korean (Hangul). Words with the letters in a different order, like "대한민국" and "국민대한", are still checked accurately.
Is the text I enter saved on a server?
Not at all. Every sorting and comparison runs instantly in your browser's local JavaScript engine, so you can safely test password puzzles or secret hints.
This article was adapted from our Korean original. Read the Korean original