Infection with the human immunodeficiency virus (HIV) is the only infectious disease for which anonymous testing is publicly funded, an exception that has been controversial. To assess whether anonymous HIV testing was associated with earlier HIV testing and HIV-related medical care than confidential HIV testing. Retrospective cohort. Arizona, Colorado, Missouri, New Mexico, North Carolina, Oregon, and Texas. Probability sample of 835 new acquired immunodeficiency syndrome (AIDS) cases reported to the state health department's HIV/AIDS Reporting System from May 1995 through December 1996. All had responded to the AIDS Patient Survey; 643 had been tested confidentially for HIV, and 192 had been tested anonymously. First CD4+ cell count; number of days from HIV-positive test result to first HIV-related medical care, from first HIV-related medical care to AIDS, and from first HIV-positive test result to AIDS. Persons tested anonymously sought testing and medical care earlier in the course of HIV disease than did persons tested confidentially. Mean first CD4+ cell count was 0.427x 10(9)/L in persons tested anonymously vs 0.267x 10(9)/L in persons tested confidentially. Persons tested anonymously experienced an average of 918 days in HIV-related medical care before an AIDS diagnosis vs 531 days for persons tested confidentially. The mean time from learning they were HIV positive to the diagnosis of AIDS was 1246 days for persons tested anonymously vs 718 days for persons tested confidentially. After adjustment for the subject's age, sex, race/ethnicity, education, income, insurance status, HIV exposure group, whether the respondent had a regular source of care or symptoms at the time of the HIV test, and state residence, anonymous testing remained significantly associated with earlier entry into medical care (P<.001). Anonymous testing contributes to early HIV testing and medical care.