Cardiopulmonary bypass (CPB) technology provides potential for cardiac surgery, but it is followed by myocardial injury and inflammation related to ischemia–reperfusion. This meta-analysis aimed to systematically evaluate the cardioprotective effect of dexmedetomidine on cardiac surgery under CPB and its effect on accompanied inflammation. PubMed, Cochrane Library, EMBASE and Web of Science databases were comprehensively searched for all randomized controlled trials (RCTs) published before April 1st, 2021 that explored the application of dexmedetomidine in cardiac surgery. Compared with the control group (group C), the concentrations of CK-MB in the perioperative period and cTn-I at 12 h and 24 h after operation in dexmedetomidine group (group D) were significantly decreased ( P < 0.05). In addition, in group D, the levels of interleukin-6 at 24 h after operation, tumor necrosis factor-a at the 12 h and 24 h after operation were significantly decreased ( P < 0.05). At the same time, the length of Intensive Care Unit stay in group D was significantly shorter than group C ( P < 0.05). However, there was no significant difference in interleukin-10 level, C reactive protein level, the time on ventilator and length of hospital stay between the two groups ( P > 0.05). The application of dexmedetomidine in cardiac surgery with CPB can reduce CK-MB and cTn-I concentration and interleukin-6, tumor necrosis factor-α levels to a certain extent and shorten the length of Intensive Care Unit stay, but it has no significant effect on IL-10 level, C reactive protein level, the time on ventilator and length of hospital stay. Supplementary Information The online version contains supplementary material available at 10.1007/s00540-021-02982-0.