The measurement of the mass differences for systems bound by the strong force has reached a very high precision with protons and anti-protons(1,2). The extension of such measurement from (anti-)baryons to (anti-) nuclei allows one to probe any difference in the interactions between nucleons and anti-nucleons encoded in the (anti-) nuclei masses. This force is a remnant of the underlying strong interaction among quarks and gluons and can be described by effective theories(3), but cannot yet be directly derived from quantum chromodynamics. Here we report a measurement of the difference between the ratios of the mass and charge of deuterons (d) and anti-deuterons ((d) over bar), and He-3 and (3)(He) over bar nuclei carried out with the ALICE (...