We perform the three dimensional lattice simulation of the magnetic field and gravitational wave productions from bubble collisions during the first-order electroweak phase transition. Except that of the gravitational wave, the power-law spectrum of the magnetic field strength is numerically calculated for the first time, which is of a broken power-law spectrum: $B_{xi}propto f^{0.91}$ for low frequency region of $f<f_star$ and $B_{xi}propto f^{-1.65}$ for high frequency region of $f>f_star$ in the thin-wall limit, with the peak frequency being $f_starsim 5$ Hz at the phase transition temperature 100 GeV. When the hydrodynamics is taken into account, the generated magnetic field strength can reach $B_xisim 10^{-7}$G at a correlation length $xisim 10^{-7}$pc, which may seed the large scale magnetic fields. Our study shows that the measurements of cosmic magnetic field strength and gravitational waves are complementary to probe new physics admitting electroweak phase transition.