NewAPIVerve Academy: free courses and certifications anyone can verify.Explore the Academy →

Anagram Detector API

GET

Verify whether two words or phrases are true anagrams.

Anagram Detector checks whether two words or phrases are anagrams of each other. Submit two strings to receive a true or false match verdict, cleaned comparison text, and character counts with options to ignore letter case and spaces.

Try it — live request, no key required

Request
GETapi.apiverve.com/v1/anagramdetector?text1=listen&text2=silent
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "text1": "listen",
    "text2": "silent",
    "is_anagram": true,
    "cleaned_text1": "listen",
    "cleaned_text2": "silent",
    "sorted_text1": "eilnst",
    "sorted_text2": "eilnst",
    "length_text1": 6,
    "length_text2": 6,
    "similarity_percentage": 100
  }
}

About the Anagram Detector API

An anagram checker API for word games, puzzles and text comparison. Anagram Detector takes two words or phrases and tells you whether one is a rearrangement of the other, after normalizing both texts the way you choose: ignoring letter case, ignoring spaces, or both.

Every request returns the true or false verdict, the two cleaned strings that were actually compared, and their character counts, so you can show a player exactly why "Dormitory" and "dirty room" matched. Game builders use it to validate guesses in anagram rounds, teachers use it for vocabulary exercises, and developers use it to compare short strings without writing their own normalization rules.

The Free plan returns the verdict, cleaned text and lengths. Paid plans add the alphabetically sorted letters of each input and a similarity percentage, which help when two inputs are close but not exact anagrams, for example to tell a player they are one letter away.

How it works

Anagram Detector compares text1 and text2 by sorting their characters. Each input is first cleaned: with ignorecase (default true) both strings are lowercased, and with ignorespaces (default true) every run of whitespace is removed. The cleaned strings are split into characters, sorted, and joined; is_anagram is true only when the two sorted strings are identical. Punctuation and digits are not stripped, so "listen!" and "silent" are not anagrams unless you remove the exclamation mark first. Two identical inputs also return is_anagram: true.

cleaned_text1 and cleaned_text2 show the exact strings that were compared, and length_text1 and length_text2 are the lengths of those cleaned strings, not of the raw input. Turning ignorecase off makes "A" and "a" different characters; turning ignorespaces off makes spaces count as characters, so phrases with different spacing will not match.

sorted_text1 and sorted_text2 are the sorted character strings used for the comparison. similarity_percentage counts the characters the two cleaned texts share (for each character, the smaller of its two occurrence counts), divides by the length of the longer cleaned text and multiplies by 100, rounded to two decimals. A true anagram scores 100; "abc" against "abcd" scores 75. These three fields are null on the Free plan.

What people use it for

Word Games
Validate anagrams in word puzzles, Scrabble, and anagram-based games
Cryptography
Analyze anagram-based ciphers and cryptographic puzzles
Linguistics
Study anagram relationships in language research and text analysis
Educational Apps
Create interactive tools for teaching anagrams and word patterns

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Anagram Detector

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Anagram Detector API.

Read the docs →
Is it cheap enough to check anagrams on every user guess?
Yes. Each comparison costs 1 credit, which works out to about $0.00015 per call or $0.15 per 1,000 calls on the Starter plan. The Free plan includes 200 checks each month for testing before upgrading.
Do I get similarity scoring and sorted letters on the Free plan?
No. The Free plan reports whether texts are anagrams along with their cleaned lengths, but the similarity percentage score and sorted letter lists require any paid plan, starting with Starter.
Can it compare multi-word phrases with mixed casing and spaces?
Yes. By default, both casing and spaces are ignored during comparison, so phrases like debit card and bad credit match automatically. You can toggle these options if your application requires strict case or whitespace matching.
Can I evaluate near-matches if two inputs are not exact anagrams?
Yes, on paid plans. The endpoint computes a similarity percentage alongside the boolean check. This lets your application score partial matches and award partial credit in word puzzles even when letters do not align completely.
What happens when two submitted texts have different lengths?
The API marks the anagram result as false while still returning the individual lengths and cleaned text strings. If you are on a paid plan, it also calculates the similarity score across the mismatched inputs.

Ready to build with Anagram Detector? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs