To monitor the use of tenofovir disoproxil fumarate/emtricitabine (TDF/FTC) and related medicines for pre-exposure prophylaxis (PrEP) as HIV prevention using commercial pharmacy data, it is necessary to determine whether TDF/FTC prescriptions are used for PrEP, or for some other clinical indication. To validate an algorithm to distinguish the use of TDF/FTC for HIV prevention or infectious disease treatment. An algorithm was developed to identify whether TDF/FTC prescriptions were for PrEP or for other indications from large-scale administrative databases. The algorithm identifies TDF/FTC prescriptions, and then excludes patients with International Classification of Diseases (ICD)-9 diagnostic codes, medications or procedures that suggest indications other than for PrEP (e.g., documentation of HIV infection, chronic hepatitis B (CHB), or use of TDF/FTC for post-exposure prophylaxis (PEP)). For evaluation, we collected data by clinician assessment of medical records for patients with TDF/FTC, and compared the assessed indication identified by the clinician review with the assessed indication identified by the algorithm. The algorithm was then applied and evaluated in a large urban community-based sexual health clinic. The PrEP algorithm demonstrated high sensitivity and moderate specificity (99.6%, 49.6%) in the electronic medical record database, and high sensitivity and specificity (99%, 87%) in data from the urban community health clinic. The PrEP algorithm classified the indication for PrEP in most subjects treated with TDF/FTC with sufficient accuracy to be useful for surveillance purposes. The methods described can serve as a basis for developing a robust and evolving case definition for antiretroviral prescriptions for HIV prevention purposes. None required.