Objective To quantify the impact of citalopram and other selective serotonin reuptake inhibitors on corrected QT interval (QTc), a marker of risk for ventricular arrhythmia, in a large and diverse clinical population. Design A cross sectional study using electrocardiographic, prescribing, and clinical data from electronic health records to explore the relation between antidepressant dose and QTc. Methadone, an opioid known to prolong QT, was included to demonstrate assay sensitivity. Setting A large New England healthcare system comprising two academic medical centres and outpatient clinics. Participants 38 397 adult patients with an electrocardiogram recorded after prescription of antidepressant or methadone between February 1990 and August 2011. Main outcome measures Relation between antidepressant dose and QTc interval in linear regression, adjusting for potential clinical and demographic confounding variables. For a subset of patients, change in QTc after drug dose was also examined. Results Dose-response association with QTc prolongation was identified for citalopram (adjusted beta 0.10 (SE 0.04), P<0.01), escitalopram (adjusted beta 0.58 (0.15), P<0.001), and amitriptyline (adjusted beta 0.11 (0.03), P<0.001), but not for other antidepressants examined. An association with QTc shortening was identified for bupropion (adjusted beta 0.02 (0.01) P<0.05). Within-subject paired observations supported the QTc prolonging effect of citalopram (10 mg to 20 mg, mean QTc increase 7.8 (SE 3.6) ms, adjusted P<0.05; and 20 mg to 40 mg, mean QTc increase 10.3 (4.0) ms, adjusted P<0.01). Conclusions This study confirmed a modest prolongation of QT interval with citalopram, and identified additional antidepressants with similar observed risk. Pharmacovigilance studies using electronic health record data may be a useful method of identifying potential risk associated with treatments.