Objective To validate a single-lead electrocardiogram algorithm for identifying atrial fibrillation, atrial premature beats, ventricular premature beats, and sinus rhythm. Methods A total of 656 subjects aged 19 to 94 years were enrolled. Participants were simultaneously tested with a wristwatch (Huawei Watch GT2 Pro, Huawei Technologies Co., Ltd, Shenzhen, China) and a 12-lead electrocardiogram for 3 minutes. A total of 1926 electrocardiogram signals from 628 subjects (282 men and 346 women) aged 19 to 94 years (median 64 years) were analyzed using an algorithm. Results The numbers of subjects with atrial fibrillation, atrial premature beats, ventricular premature beats, and sinus rhythm were 129, 141, 107, and 251, respectively, and together they had a total of 1926 electrocardiogram signals. For the three-class classification system, the recall, precision, and F1 score were 97.6%, 96.5%, 97.0% for sinus rhythm; 96.7%, 96.9%, 96.8% for atrial fibrillation; and 92.8%, 94.2%, 93.5% for ectopic beats, respectively. The macro-F1 score of the three-class classification system was 95.8%. For the four-class classification system, the recall, precision, and F1 score were 97.6%, 96.5%, 97.0% for sinus rhythm; 96.7%, 96.9%, 96.8% for atrial fibrillation; 90.5%, 89.4%, 89.9% for atrial premature beats; and 86.1%, 89.6%, 87.8% for ventricular premature beats, respectively. The macro-F1 score of the four-class classification system was 92.9%. Conclusions The single-lead electrocardiogram algorithm embedded into smart wearables demonstrated good performance in detecting atrial fibrillation, atrial/ventricular premature beats, and sinus rhythm, and thus would facilitate atrial fibrillation screening and management.