Purpose: To examine the validity of International Classification of Diseases-Ninth Revision (ICD-9) and Current Procedural Terminology (CPT) codes for knee replacement and hip replacement in Veterans Affairs (VA) databases. Methods: From a cohort of veterans who received health care at Minneapolis VA Medical Center and/or affiliated medical facilities, we obtained four random samples of 50 patients each with: neither hip nor knee replacement code, knee replacement code only, hip replacement code only and both knee and hip replacement codes. The gold standard was documentation of knee or hip replacement surgery in patient medical records. Accuracy of ICD-9 or CPT code for knee and hip replacement was assessed by calculating sensitivity, specificity, positive and negative predictive values (PPV and NPV). Results: Of the 200 patients, medical records were available for 166:140 (70%) had complete medical records and 26 (13%) had incomplete medical records. Knee replacement codes were accurate with excellent PPV of 95%, sensitivity of 95%, specificity of 96% and NPV of 96%. Hip replacement codes were accurate with excellent PPV of 98%, sensitivity of 96%, specificity of 99% and NPV of 96%. Sensitivity analyses that included incomplete charts had little impact on these estimates. The procedure dates found in VA databases matched exactly with medical records in 96%. Conclusions: The ICD-9 and CPT codes for knee replacement and hip replacement in VA databases are valid. These codes may be used to identify cohorts of veterans with knee replacement and hip replacement for research studies. © 2010.