I will present the results of numerical relativity simulations of compact object binaries. I will focus in particular on the effects that magnetic fields can have in two different scenarios: binary neutron stars and supermassive black hole binaries. In the first one, magnetic fields can affect the post-merger evolution of the remnant and in particular its gravitational and electromagnetic emission. In the latter, we expect the mergers of supermassive black holes to happen in regions where the presence of magnetized plasma can give rise to relativistic jets and electromagnetic radiation. Both binary neutron stars and supermassive black hole binaries are strong sources of gravitational waves for current and future detectors. Understanding their electromagnetic emission can provide further information on the binary properties when combined with their gravitational wave signals.