ForHosting KIT · Developer Utilities

Double Metaphone encoder

Type a name and get two sound-alike keys: Smith gives SM0 as its main code and XMT as the alternate, so records spelled differently but pronounced alike can be found together before a duplicate is created. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
Smith
You get
Primary
SM0
Alternate
XMT
Tokens
1
Encoding
double_metaphone

Double Metaphone is Lawrence Philips’ improved phonetic algorithm that maps names and words to compact primary and alternate keys so records that sound alike still match across English, Germanic, Romance, Slavic, and other language origins. Unlike single-key Metaphone or Soundex, it returns two codes when pronunciations diverge, which is why Smith and Schmidt can share a branch of the key space while Catherine and Katherine collapse to the same pair. This capability accepts a non-empty text field, normalizes letters, runs a pure deterministic Double Metaphone encode, and returns primary, alternate, whether the keys differ, and token count.

What Double Metaphone returns and how primary vs alternate keys work

Double Metaphone walks an uppercase letter buffer and emits two short phonetic strings: a primary key that captures the most common English-oriented reading, and an alternate key that captures a second plausible pronunciation when language origin or spelling patterns create ambiguity. Classic keys are four characters long; letters map to a reduced consonant inventory where, for example, B becomes P, V becomes F, and the digraph TH often becomes zero or T depending on context.

Multi-word input is split into letter tokens; each token is encoded and the keys are joined with spaces so a full personal name still produces a stable, reviewable pair. Diacritics are stripped with Unicode normalization before encoding so café-style letters do not invent empty keys, while pure digit or punctuation strings are rejected as invalid because there is no phonetic content to encode.

Where Double Metaphone earns its keep and how pricing fits

Customer-data platforms, CRM merge tools, and genealogy sites use a Double Metaphone encoder so smith-like and schmidt-like surnames surface together without forcing users to learn regex. Call-center and hospital registration screens can precompute keys when a clerk types a name, then suggest possible matches before creating a duplicate record. Classroom and NLP labs use the free in-browser tool to show why alternate keys exist and how language origin rules change the code for J, CH, and GN clusters.

Prefer this landing when search intent is double metaphone encoder or double metaphone phonetic code; NATO spelling alphabets and Base64 encoders answer different intents and should stay on their own pages. Source text follows the same retention rules as other KIT parse items, and results are safe to pin in tests because the algorithm is fully deterministic.

CRM and customer record deduplication

Index primary and alternate Double Metaphone keys on surnames so Smith, Smyth, and Schmidt candidates surface together before merge.

Genealogy and historical name search

Link anglicized and original-language spellings in family trees by matching Double Metaphone pairs instead of exact strings only.

Fuzzy search indexes and data quality jobs

Nightly pipelines encode new names, store both keys, and flag near-duplicates when primary or alternate keys collide with existing rows.

What is Double Metaphone and what does this encoder return?

Double Metaphone maps a name or word to a primary phonetic key and an optional alternate key for a second pronunciation.

Why are there two keys instead of one like Soundex?

Many names have more than one plausible reading across language origins. Storing primary and alternate (for example Smith as SM0 and XMT) raises recall without inventing a single ambiguous code.

What happens on empty or invalid input?

Successful calls need at least one A–Z letter after normalization.

Do Catherine and Katherine get the same codes?

Yes for this implementation: both encode to primary K0RN and alternate KTRN, which is the classic fuzzy-match behaviour people expect from Double Metaphone.

Can I encode a full name with several words?

Yes. Each word is encoded on its own and the keys are joined with spaces, so a first name and a surname give a stable pair you can review. Accents are removed first, so accented letters still produce a key.

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.

POSThttps://api.kit.forhosting.com/enc/double-metaphone

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.

curl -X POST https://api.kit.forhosting.com/enc/double-metaphone \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Smith"}'
{
  "text": "Smith"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.double_metaphone",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Empty strings, whitespace-only input, and strings with no Latin letters fail with invalid_input so clients never store hollow phonetic rows.

What Double Metaphone returns and how primary vs alternate keys work

When both readings agree—as with many simple names—the alternate equals the primary and keys_differ is false, which tells search layers they can index a single code. The response always includes the original text field, encoding equal to double_metaphone, and tokens equal to how many letter groups were processed, so openapi clients and widgets can show provenance next to the codes without a second round-trip.

Input contract, validation, and how to call the encoder

There is no separate mode field: this capability only encodes to Double Metaphone; it does not reverse keys back into words, because phonetic codes are many-to-one by design. Use primary for default indexes and keep alternate in a second inverted index or OR-clause when you need the broader Philips match set. POST a JSON body with the required string field text set to a non-empty name or word; aliases input, value, s, word, and name are accepted when forms or SDKs reuse older labels. Maximum length is two thousand characters so ordinary personal names, company labels, and short lists fit a Worker isolate item call without inviting multi-megabyte dumps. On success the body carries text (echoed input after trim), primary, alternate, keys_differ as a boolean, tokens as an integer count of letter runs, and encoding set to double_metaphone for self-describing pipelines.

Where Double Metaphone earns its keep and how pricing fits

Search backends that already store Soundex or single Metaphone can add Double Metaphone as a second column without replacing legacy codes, because this endpoint never mutates source text—it only returns keys. Automation scripts call the prepaid KIT API at $0.002 per successful item when a nightly dedupe job needs a stable contract under balance; validation failures do not consume balance. Keep payloads to ordinary name and word sizes, store both keys when keys_differ is true, and combine phonetic match with edit distance or token overlap so high-recall merge candidates still get a human or secondary score before write.

What does the Double Metaphone encoder cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful item; invalid input is not billed.

Read the full KIT documentation →