The objective of this work is the computational simulation of a patient-specific electrocardiogram (EKG) using a novel, robust, efficient, and modular finite element-based simulation tool for cardiac electrophysiology. We apply a two-variable approach in terms of a fast action potential and a slow recovery variable, whereby the latter phenomenologically summarizes the concentration of ionic currents. The underlying algorithm is based on a staggered solution scheme in which the action potential is introduced globally as nodal degree of freedom, while the recovery variable is treated locally as internal variable on the integration point level. We introduce an unconditionally stable implicit backward Euler scheme to integrate the evolution equations for both variables in time, and an incremental iterative Newton-Raphson scheme to solve the resulting nonlinear system of equations. In a straightforward post-processing step, we calculate the flux of the action potential and integrate it over the entire domain to obtain the heart vector. The projection of the heart vector onto six pre-defined directions in space defines a six-lead EKG. We illustrate its generation in terms of a magnetic resonance-based patient-specific heart geometry and discuss the clinical implications of the computational electrocardiography. Copyright (C) 2009 John Wiley & Sons, Ltd.