The Minnesota code (MC) is a classification system for electrocardiograms (ECGs) that is used for ECG coding in epidemiologic studies. As the MC measurement procedures and rules are complex, visual coding is time-consuming and error-prone. Automation should reduce measurement and coding errors. The authors developed an MC program, closely adhering to the MC regulations. To validate the program, a test set of 300 ECGs containing a wide variety of codable patterns was collected. The ECGs were coded independently by the program and by an experienced human reader. A reference code ("truth") was established by resolving disagreements through a consensus procedure. If the computer and human agreed, they were considered to be correct. Sensitivity and specificity were computed for each of the nine main code categories of the MC, both for the computer and for visual coding. The results show that the program is as good as or better than the human reader for sensitivity and specificity of all MC categories. Particularly noteworthy is the good program performance for arrhythmia coding. Most coding differences between the program and truth arise from small, borderline measurement differences in combination with the all-or-none character of the coding criteria. In conclusion, computerized Minnesota coding is a valuable alternative or supplement to visual coding.