Clinicians and microbiologists will participate in voluntary national reporting of HIV infections and AIDS only if they have confidence in the scheme's confidentiality. At the same time, if the data are to be accurate, it must be possible to recognise reports that refer to the same individual. The use of surname 'soundex' code in combination with date of birth meets both requirements. We describe its use in the database of reported HIV infections held at the PHLS AIDS Centre. By the end of 1994 over 93% of the 20,407 reports on the database were soundex coded, and 70% of AIDS reports were linked to independent reports of HIV infection from microbiologists. In 1994, 22% of the reports of HIV infection were recognised as duplicating earlier reports of infection. Coding surnames using soundex is an acceptable and practical tool in surveillance of an infection for which confidentiality is a prime concern.