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 for 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_{ξ}∝f^{0.91} for the low-frequency region of f<f_{⋆} and B_{ξ}∝f^{-1.65} for the high-frequency region of f>f_{⋆} in the thin-wall limit, with the peak frequency being f_{⋆}∼5 Hz at the phase transition temperature 100 GeV. When the hydrodynamics is taken into account, the generated magnetic field strength can reach B_{ξ}∼10^{-7} G at a correlation length ξ∼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.