Anaemia is an important health-care burden globally, and screening for anaemia is crucial to prevent multi-organ injury, irreversible complications, and life-threatening adverse events. We aimed to establish whether a deep learning algorithm (DLA) that enables non-invasive anaemia screening from electrocardiograms (ECGs) might improve the detection of anaemia. We did a retrospective, multicentre, diagnostic study in which a DLA was developed using ECGs and then internally and externally validated. We used data from two hospitals, Sejong General Hospital (hospital A) and Mediplex Sejong Hospital (hospital B), in South Korea. Data from hospital A was for DLA development and internal validation, and data from hospital B was for external validation. We included individuals who had at least one ECG with a haemoglobin measurement within 1 h of the index ECG and excluded individuals with missing demographic, electrocardiographic, or haemoglobin information. Three types of DLA were developed with 12-lead, 6-lead (limb lead), and single-lead (lead I) ECGs to detect haemoglobin concentrations of 10 g/dL or less. The DLA was built by a convolutional neural network and used 500-Hz raw ECG, age, and sex as input data. The study period ran from Oct 1, 2016, to Sept 30, 2019, in hospital A and March 1, 2017, to Sept 30, 2019, in hospital B. 40 513 patients at hospital A and 4737 patients at hospital B were eligible for inclusion. We excluded 281 patients at hospital A and 72 patients at hospital B because of missing values for clinical information and ECG data. The development dataset comprised 57 435 ECGs from 31 898 patients, and the algorithm was internally validated with 7974 ECGs from 7974 patients. The external validation dataset included 4665 ECGs from 4665 patients. 586 (internal) and 194 (external) patients within the combined dataset were found to be anaemic. During internal and external validation, the area under the receiver operating characteristics curve (AUROC) of the DLA using a 12-lead ECG for detecting anaemia was 0·923 for internal validation and 0·901 for external validation. Using a 90% sensitivity operating point for the development data, the sensitivity, specificity, negative predictive value, and positive predictive value of internal validation were 89·8%, 81·5%, 99·4%, and 20·0%, respectively, and those of external validation were 86·1%, 76·2%, 99·2%, and 13·5%, respectively. The DLA focused on the QRS complex for deciding the presence of anaemia in a sensitivity map. The AUROCs of DLAs using 6 leads and a single lead were in the range of 0·841-0·890. In this study, using raw ECG data, a DLA accurately detected anaemia. The application of artificial intelligence to ECGs could enable screening for anaemia. None.