Using Soundex, Metaphone, and Fuzzy Matching to Search Surname Variants

Short Answer

Soundex, Metaphone, and fuzzy matching are search aids that generate candidate surname spellings based on pronunciation or string similarity. They can help find records when spelling varies, but they do not prove that names are variants or that people are related. Use them to build a candidate list, then verify against original records and other identifying details.

What phonetic and fuzzy surname searching can and cannot do

When a surname appears in records under more than one spelling, a search box that demands an exact match can hide the very entry you need. Phonetic matching and fuzzy matching are two families of search aids designed to widen a search without abandoning the name altogether. Phonetic algorithms convert a name into a code based on how it sounds. Fuzzy matching compares strings by how similar they are, character by character. Both can produce useful candidates. Neither can prove that two spellings are historical variants of one another, and neither can prove that two people with similar surnames are related.

This guide treats Soundex, Daitch-Mokotoff Soundex, Metaphone, Double Metaphone, and Levenshtein distance as search tools. The technical descriptions below follow the PostgreSQL 18 documentation for the fuzzystrmatch module, which provides implementations of these functions. Other genealogy websites, archives, and database systems may use different implementations, different default settings, or no phonetic search at all. Always check the search help for the platform you are using before assuming a particular syntax or behaviour.

How the main methods work

Soundex

Soundex is one of the oldest and best-known phonetic coding systems. The PostgreSQL documentation describes it as a method of matching similar-sounding names by converting them to the same code. It was initially used by the United States Census in 1880, 1900, and 1910. In the fuzzystrmatch module, soundex(text) returns a Soundex code, and difference(text, text) converts two strings to their Soundex codes and reports the number of matching code positions. Because Soundex codes have four characters, the result ranges from zero to four, where zero is no match and four is an exact match.

For surname research, Soundex can group together names that sound alike in English, such as names beginning with similar consonant patterns. Its limits matter. The PostgreSQL documentation warns that Soundex is not very useful for non-English names. A researcher working with Irish, Scottish, Welsh, or other multilingual name material should not assume that a Soundex match is meaningful simply because the search engine returned it. Soundex is a starting point, not a conclusion.

Daitch-Mokotoff Soundex

Daitch-Mokotoff Soundex was designed to be more useful for non-English names. The PostgreSQL documentation explains that it is based on the first six meaningful letters rather than four, maps letters or letter combinations into ten possible codes rather than seven, codes two consecutive letters with a single sound as a single number, and emits multiple codes when a letter or combination may have different pronunciations. The function daitch_mokotoff(source text) returns an array of one or more codes. For example, the documentation shows daitch_mokotoff('John') returning {160000,460000} and daitch_mokotoff('Schwartzenegger') returning {479465}.

That array behaviour is important. A single name may have more than one plausible pronunciation, so a single code would be too narrow. The documentation notes that returned text arrays can be matched directly using the overlap operator for single-name matching, and that a GIN index may be used for efficiency. For a family historian, the practical lesson is that Daitch-Mokotoff can generate several candidate codes for one recorded spelling. Each code is a search key, not a statement that the name has one fixed pronunciation or origin.

Metaphone and Double Metaphone

The fuzzystrmatch module also provides metaphone, dmetaphone, and dmetaphone_alt functions. Metaphone-type algorithms are phonetic encodings used to match names that sound similar. The PostgreSQL documentation includes an important caution: at present, soundex, metaphone, dmetaphone, and dmetaphone_alt do not work well with multibyte encodings such as UTF-8. For such data, the documentation recommends using daitch_mokotoff or levenshtein instead.

This caution is directly relevant to surname research because many modern databases store names in UTF-8, and many surnames include characters outside the basic English alphabet. If a search tool exposes Metaphone or Double Metaphone, it may still be useful for some English-language collections. But if the data include accented letters, non-Latin scripts, or other multibyte characters, the result may be unreliable. The safer approach is to test the tool on known spellings from your own records and to compare its output with other search methods.

Levenshtein distance and fuzzy matching

Levenshtein distance is not a phonetic code. It calculates the distance between two strings by counting the cost of insertions, deletions, and substitutions needed to turn one string into the other. The PostgreSQL documentation describes both a five-argument form with explicit insertion, deletion, and substitution costs and a two-argument form. A lower distance means the strings are more similar; an exact match has a distance of zero. Fuzzy matching is the broader idea of finding strings that are approximately similar rather than exactly equal.

Levenshtein distance can catch typographical errors, omitted letters, doubled letters, and small transcription differences that phonetic codes may miss. It can also produce false positives, especially for short surnames, because a small edit distance can link names that are not historically related. A fuzzy match is a candidate for review, not a documented variant.

Why one method is not enough

Different methods answer different questions. Soundex asks whether two names share a rough English phonetic pattern. Daitch-Mokotoff asks whether they share one of several possible non-English phonetic patterns. Metaphone and Double Metaphone ask similar phonetic questions but with different rules and, in the PostgreSQL implementation, important encoding limitations. Levenshtein asks how many character edits separate two strings. None of them knows the history of a particular family.

A surname may appear in different forms for several reasons. A clerk may have written what they heard. A census enumerator may have simplified a name. A transcriber may have misread handwriting. A family may have used different spellings in different records. A name may also have more than one independent origin, so two similar spellings may never have been connected. Phonetic and fuzzy searches help you find possible records; they do not tell you which of these explanations applies.

For that reason, a good search strategy uses more than one method and records what each method returned. If Soundex finds nothing, Daitch-Mokotoff or Levenshtein may find a candidate. If a phonetic search returns too many results, a fuzzy search with a tighter edit distance may help narrow the list. If both return nothing, the problem may be the index, the record coverage, or the search syntax rather than the surname itself.

A practical workflow for surname-variant searching

  1. Start with the recorded spelling. Transcribe the surname exactly as it appears in the record, including punctuation, spacing, and capitalization. Note the record type, date, place, and source. If you are working from an index, look for the original image when it is available.
  2. List observed variants separately from search guesses. An observed variant is a spelling you have actually seen in a record. A search candidate is a form you are trying because a tool suggested it. Keep these in two columns or two lists so you do not accidentally treat a search suggestion as evidence.
  3. Choose a method that fits the data. For English-language collections, Soundex may be available and useful. For non-English or multilingual names, consider Daitch-Mokotoff or Levenshtein, especially because the PostgreSQL documentation warns that Soundex and Metaphone-type functions do not work well with multibyte encodings such as UTF-8.
  4. Generate codes or similarity scores. If the platform exposes phonetic codes, record the code for each spelling. If it exposes fuzzy matching, record the distance or score. This makes your search reproducible and helps you see why a result appeared.
  5. Search exact, phonetic, and fuzzy forms. Try the recorded spelling first. Then try the phonetic or fuzzy search. Use the platform’s actual syntax; quotation marks, wildcards, and punctuation rules differ by system. Check the database’s search help rather than assuming that a method from another site will work.
  6. Compare other identifiers. Do not accept a candidate on surname similarity alone. Compare given names, ages or dates, places, occupations, family members, and record context. A phonetic match with a different birthplace and different parents is usually a different person.
  7. Retrieve the original record or image. An index entry may contain a transcription error. The original image may show a spelling that the indexer normalized, missed, or misread. Record what the original says separately from what the index says.
  8. Log negative results. If a search returns nothing, write down the exact spelling, method, database, date of search, and result. A no-result may mean the person is not in that dataset, the surname is indexed differently, the record is not covered, or the search method failed. It is not proof that the surname did not exist.
  9. Repeat with another method or dataset. If one approach fails, try a different algorithm, a different spelling from your observed list, or a different record collection with a known scope. Keep the same identifying details in view.

Teaching illustration: comparing a spelling, a search candidate, and evidence

The table below is an instructional example only. It does not represent a specific archive record or a verified historical family.

Illustrative comparison of surname search candidates
Recorded spellingSearch methodCandidate returnedWhat it may meanNext check
SmythSoundex or MetaphoneSmithPossible phonetic match; not proven as a variant for this familyCompare dates, places, and relatives in the original records
O BrienPunctuation or space handlingO’BrienSearch-system variation; may reflect indexing rather than a historical spelling changeCheck the original image and the database’s punctuation rules
Mac DonaldLevenshtein or fuzzy matchingMcDonaldSmall string difference; could be a transcription or indexing variantLook for the same person in another record type

Pitfalls and limits

  • A phonetic match is not a relationship. Two names can share a code without sharing an ancestor. Soundex and similar methods group sounds, not families.
  • A fuzzy match is not a documented variant. Levenshtein distance measures string similarity. It does not know whether a spelling was used by a particular family, clerk, or community.
  • Soundex is not universal. The PostgreSQL documentation states that Soundex is not very useful for non-English names. Daitch-Mokotoff was designed to be more useful for non-English names, but it too produces codes, not conclusions.
  • Encoding matters. The same documentation cautions that soundex, metaphone, dmetaphone, and dmetaphone_alt do not work well with multibyte encodings such as UTF-8. Use daitch_mokotoff or levenshtein for such data, or verify the platform’s behaviour.
  • Indexes are not originals. A search result may come from a transcription or index. The original record may spell the name differently or contain additional identifying details.
  • No result is not proof of absence. A surname missing from a search may be indexed under another spelling, excluded from the dataset, or simply not covered by that collection.
  • Do not merge people on surname alone. Similar surnames, even identical surnames, do not establish that two records describe the same person or that two families are related.

What to do next

After you have generated a candidate list, choose one record set with a known scope and search it systematically. For example, if you are working with English census returns, search the recorded spelling first, then try a phonetic method, then a fuzzy method, and compare the results with the person’s age, birthplace, and household members. If you are working with civil registration or parish registers, check the original register image or the archive’s own index rather than relying only on a third-party transcription.

If you use a database system that supports the PostgreSQL fuzzystrmatch module, you can test the functions on your own spelling lists and see how they behave. The documentation for fuzzystrmatch provides the function names and examples. For most family historians, however, the practical equivalent is the phonetic or fuzzy search option offered by the genealogy website or archive. The same rule applies: use it to widen the search, then verify every candidate against records.

Keep a variant log with columns for the spelling as recorded, the source and date, the search method, the candidate returned, and the evidence that supports or rejects it. That log becomes the basis for the next research step: locating a document that connects a person to a place, a date, and a family, rather than a document that merely contains a similar-sounding name.

Evidence basis and editorial status

The technical descriptions of Soundex, Daitch-Mokotoff Soundex, Metaphone, Double Metaphone, and Levenshtein in this guide are based on the PostgreSQL 18 documentation for the fuzzystrmatch module. Platform-specific search syntax, available collections, and access rules can change and should be checked against the relevant database or archive help. This article is an editorial draft; editorial review pending.

FAQ

Can Soundex find Irish or Welsh surname variants?

Soundex was designed for English-language names, and the PostgreSQL documentation warns that it is not very useful for non-English names. Daitch-Mokotoff Soundex was designed to be more useful for non-English names, but it still produces search candidates rather than proof of a variant or relationship.

Does a Levenshtein distance of zero mean two records are the same person?

No. A distance of zero means the two strings are identical. Identical surnames can belong to different people, so you still need dates, places, relatives, and other record details to decide whether the records describe the same person.

Are Soundex codes the same on every website?

Not necessarily. The PostgreSQL documentation describes its own implementations of Soundex and related functions. Other websites and archives may use different rules, settings, or search features, so check the platform's help before relying on a particular code or syntax.

What should I do if a phonetic search returns too many results?

Narrow the search with other identifiers such as given names, approximate dates, places, and family members. You can also try a fuzzy match with a tighter similarity threshold, or use a different method such as Daitch-Mokotoff if the name data are non-English or multilingual. A large result list is a sign that the surname alone is not selective enough.

References

  1. PostgreSQL Global Development Group. PostgreSQL 18 Documentation: F.16. fuzzystrmatch — determine string similarities and distance. Current documentation, retrieved October 8, 2026. https://www.postgresql.org/docs/current/fuzzystrmatch.html

Related Terms

Leave a Reply

Your email address will not be published. Required fields are marked *