Electronic health records hold great promise for clinical and epidemiologic research. Undertaking atopic eczema (AE) research using such data is challenging because of its episodic and heterogeneous nature. We sought to develop and validate a diagnostic algorithm that identifies AE cases based on codes used for electronic records used in the UK Health Improvement Network. We found that at least one of five diagnosis codes plus two treatment codes for any skin-directed therapy were likely to accurately identify patients with AE. To validate this algorithm, a questionnaire was sent to the physicians of 200 randomly selected children and adults. The primary outcome, positive predictive value for a physician-confirmed diagnosis of AE, was 86% (95% confidence interval = 80-91). Additional criteria increased the PPV up to 95% but would miss up to 89% of individuals with physician-confirmed AE. The first and last entered diagnosis codes for individuals showed good agreement with the physician-confirmed age at onset and last disease activity; the mean difference was 0.8 years (95% confidence interval = -0.3 to 1.9) and -1.3 years (95% confidence interval = -2.5 to -0.1), respectively. A combination of diagnostic and prescription codes can be used to reliably estimate the diagnosis and duration of AE from The Health Improvement Network primary care electronic health records in the UK.