What this tool does
Caverphone is a phonetic matching algorithm created by David Hood at the University of Otago for the Caversham project, which linked New Zealand electoral and census records full of inconsistent spellings. This encoder implements Caverphone 2.0, the 2004 revision, producing a fixed 10-character code in your browser. It is especially good at matching New Zealand, Australian and English surnames.
The historical problem Caverphone solves
The Caversham project was trying to link 19th- and early-20th-century New Zealand electoral rolls and census returns — hand-written records where a single surname like “MacPherson” might appear as MacPhearson, McFerson, MacFerson, or Macphearson across different clerks and decades. Standard English phonetic algorithms like Soundex, which were tuned for American census data, handled these Celtic and British names poorly. Caverphone was designed specifically for the pronunciation patterns of names that arrived with settlers from Britain, Ireland, and Europe into a New Zealand context.
How it works
Caverphone 2.0 is defined as a strict sequence of string substitutions applied in a fixed order — the order itself is part of the specification. It begins by removing a trailing E and rewriting special openings:
^cough -> cou2f ^gn -> 2n mb$ -> m2
ce -> se ci -> si tch -> 2ch
c/q/x -> k v -> f ph -> fh
b -> p sh -> s2 z -> s
After the consonants are normalised, vowels are coded (a leading vowel becomes A, others become 3), then runs of identical consonant letters are collapsed (S+, T+, P+, K+ and so on). Finally the placeholder digits 2 and 3 are stripped, the result is right-padded with the digit 1, and it is truncated to exactly ten characters.
Reference codes and how to use them
| Name | Caverphone 2.0 code |
|---|---|
| Stevenson | STFNSN1111 |
| Stephenson | STFNSN1111 |
| Thompson | TMPSN11111 |
| Thomson | TMPSN11111 |
| Peter | PTA1111111 |
| Caverphone | KFFN111111 |
Notice that “Stevenson” and “Stephenson” produce the same code — exactly the kind of variant-matching the algorithm is designed for. In a database, you index the Caverphone code alongside the original name, then query on the code to find all phonetically similar rows regardless of how the name was spelled.
The best workflow is to use Caverphone as a candidate-generation step: retrieve all records sharing the same code, then apply closer comparison (edit distance, or human review) to confirm a true match. Storing the fixed-width code in a separate indexed column makes that query fast even on large archives.
Because every code is exactly ten characters wide, Caverphone keys require no padding or length management in a database, unlike Soundex which varies between three and four characters. This fixed-width property also means you can compare codes with a simple string equality check rather than a range scan.
All encoding happens locally — no data is sent anywhere.