To compare endothelial loss between recipients who received viral DNA-positive grafts and controls 2 years after corneal transplantation. We retrospectively analysed the clinical data and endothelial cell density of recipients of viral DNA-positive grafts and age-, sex-, aetiology- and operation-matched controls from April 2017 to July 2019 at the Peking University Third Hospital, Beijing, China. A total of 23/942 (2.44%) donor corneal buttons tested virus-positive by real-time PCR. A total of 27 recipients (except for 2 recipients) of viral DNA-positive grafts and 48 recipients of viral DNA-negative grafts were included in this study. Recipients of viral DNA-positive grafts had a higher endothelial cell (EC) loss rate post-penetrating keratoplasty and post-descemet stripping automated endothelial keratoplasty (p<0.05), but post-deep lamellar keratoplasty, the EC loss rate was similar to that of the controls. Recipients of herpes simplex virus-1-, cytomegalovirus- and varicella-zoster virus-positive grafts all had a higher EC loss rate than the controls during the 12- and 24-month follow-up periods (p<0.05). We inferred that viruses might be hidden in corneal grafts and mainly incubate in the corneal endothelium. Viral DNA-positive grafts do not need to be replaced immediately and can be followed up for a long time. © Author(s) (or their employer(s)) 2022. Re-use permitted under CC BY-NC. No commercial re-use. See rights and permissions. Published by BMJ.