Prenatal exposure to maternal diabetes is associated with an increased risk of offspring heart defects. We evaluated associations with subtle infant cardiac changes. In a cohort of 25,486 infants with transthoracic echocardiography within 60 days of birth, we investigated associations between maternal preexisting diabetes and gestational diabetes mellitus (GDM) and infant left ventricular (LV) structural and functional parameters, using linear regression to estimate adjusted mean differences (aMDs) between groups. Infants exposed to maternal preexisting diabetes (n = 198) had thicker LV posterior walls (aMD 0.19 mm; 95% CI 0.11, 0.27), smaller LV internal diameters in systole (aMD -0.27 mm; 95% CI -0.45, -0.18) and diastole (aMD -0.37 mm; 95% CI -0.59, -0.09), reduced stroke volumes (aMD -0.36 mL; 95% CI -0.61, -0.11), and increased heart rates (aMD 3.14 bpm; 95% CI 1.10, 6.18) and mitral valve early peak velocities (aMD 2.17 cm/s; 95% CI 0.31, 4.04) than unexposed infants (n = 24,639). Infants born to mothers with GDM (n = 649) had significantly smaller LV internal diameters in systole (aMD -0.13 mm; 95% CI -0.22, -0.03) and similar structural and functional changes as children exposed to preexisting diabetes, albeit with smaller nonsignificant aMDs. Higher third-trimester HbA1c levels were associated with smaller LV internal diameters and stroke volumes in infants exposed to preexisting diabetes and with lower heart rates in infants exposed to GDM. Maternal preexisting diabetes and, to a lesser extent, GDM were associated with changes in infant LV structure and function.