Anagram signature key
«listen» and «silent» both become eilnst: the letters sorted into one fixed order, so every rearrangement of a word shares the same key. Use it to group anagram families, check puzzle answers or match «Debit card» with «Bad credit». Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- listen
- Signature
- eilnst
- Length
- 6
- Signature length
- 6
An anagram signature is the multiset of letters in a word or phrase written in a fixed order so that every rearrangement shares one key. Puzzle solvers, dictionary pipelines, and classroom tools need that key to group listen with silent, map Debit card to Bad credit, and index anagram families without generating every permutation. This anagram signature capability accepts a text string, optionally keeps only Unicode letters and folds case, sorts the remaining characters into a stable ascending order, and returns the canonical signature string together with length fields and the resolved options.
What an anagram signature is and why sorted letters work
Two strings are anagrams of each other when they use the same letters the same number of times, ignoring order. The classic engineering trick is to map every string to a signature that encodes that multiset: lowercase the letters, drop spaces and punctuation if you are matching words rather than full character bags, then sort the remaining characters into ascending order and join them.
After that transform, listen and silent both become eilnst, and longer phrase pairs such as Debit card and Bad credit collapse to the same key once spaces disappear. Sorting is enough because a multiset of characters is fully determined by the sorted sequence; you do not need prime-factor letter products, bitmasks limited to twenty-six English letters, or expensive permutation generators.
Unicode letter filtering with the letter class keeps accented Latin, Greek, and Cyrillic scripts in the signature when they appear, while digits and symbols drop out under the default letters-only mode. Case folding by default matches how people usually talk about word anagrams: Listen and silent should not form different groups just because of capitalisation. Because the sort uses plain UTF-16 code unit order rather than a locale collation, the same string always yields the same signature across runtimes and hosts.
What you can do with it
Dictionary and word-game grouping
Index every word by its sorted-letter signature so anagram lookups return the full group in one hash-map or database query.
Classroom anagram checks
Compare a student answer to a target phrase by signature equality instead of sorting strings ad hoc in every grading script.
Phrase anagram matching
Match multi-word phrases such as Debit card and Bad credit after letters-only filtering strips spaces and folds case.
FAQ
Do listen and silent share the same signature?
Yes. Both map to eilnst under default options, so you can group or match them by comparing signature strings.
What happens if text is empty?
Empty input is not a valid signature request and is not billed.
Do spaces and capital letters count?
Not by default. Only letters are kept and they are lowercased first, which is why «Debit card» and «Bad credit» share a key. You can switch to keeping every character, spaces and digits included, and to treating capitals as different letters.
How do I group a word list into anagram families?
Work out the signature of every word and group the words by it. All the members of a family share one key, so a single lookup returns the whole group without generating a single rearrangement.
Does it work with accented letters and other alphabets?
Yes. Accented Latin letters, Greek and Cyrillic stay in the signature, while digits and symbols drop out when only letters are kept. The order is fixed, so the same text always gives the same key.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/str/anagram-signature \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"listen"}'const res = await fetch("https://api.kit.forhosting.com/str/anagram-signature", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "listen"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/str/anagram-signature",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "listen"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/str/anagram-signature", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"listen"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"listen"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/str/anagram-signature", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "listen"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "str.anagram_signature",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_chars | 100000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Empty input fails with invalid_input instead of inventing a hollow key, while punctuation-only bags under letters-only mode succeed with an empty signature you can still use as a group key.
What an anagram signature is and why sorted letters work
When you need a raw character multiset for exact bags—including spaces, digits, and punctuation—set letters_only to false and optionally keep case_sensitive true so every code unit participates. The endpoint never claims linguistic meaning, never invents dictionary definitions, and never enumerates rearrangements; it only builds the deterministic key that grouping and matching algorithms hang on.
Input contract, response shape, and error behaviour
POST a JSON body with one required field, text, the non-empty string you want turned into a signature. Aliases input, string, value, content, and s are accepted so scripts can reuse common field names. Optional letters_only defaults to true and may also be sent as lettersOnly, alpha_only, or alphaOnly; when true only Unicode letters remain before sorting, and when false every character in the (optionally lowercased) string is kept. Optional case_sensitive defaults to false and may also be sent as caseSensitive or sensitive; when false the text is lowercased first so mixed-case anagrams share a key, and when true letter case is preserved so A and a stay distinct in the sorted signature. Missing text, empty strings, non-string objects and arrays, and non-finite numbers fail with invalid_input and a message that names the problem—those validation failures are not billed. Over-length text above the declared max_chars limit is also rejected. On success the body echoes the original text and its length, reports signature as the joined sorted key, signature_length as the key length after filtering, letters_only and case_sensitive as resolved booleans, and method set to anagram_signature. Example: listen with defaults yields signature eilnst and signature_length six. Pair the key with your own hash maps or database indexes if you need multi-word anagram search; this endpoint only emits the signature and does not scan a dictionary or return candidate words.
Where an anagram signature API earns its keep
Word-game backends and crossword tooling need a stable group key so every word that rearranges to the same letters lands in one bucket for lookups and leaderboard checks. Teaching platforms use the signature as an oracle: students submit a candidate anagram and the grader compares signatures instead of sorting on every client. Failed validation does not consume balance. Data-cleaning pipelines that de-duplicate product names or fuzzy labels sometimes treat letter bags as a cheap first pass before heavier similarity models, and a tiny parse API avoids reimplementing Unicode letter filters and sort order in every language.
Technical questions
How do I get an anagram signature for a word?
Send a non-empty text string. With defaults (letters_only true, case_sensitive false) the API lowercases letters, drops non-letters, sorts them ascending, and returns signature.
What does letters_only control?
When true (default), only Unicode letters remain before sorting—spaces, digits, and punctuation drop out. When false, every character participates in the signature.
What does the anagram signature tool cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.