We calculate the accurate spectrum of the stochastic gravitational-wave background from U(1) gauge fields produced by axion dark matter. The explosive production of gauge fields soon invalidates the applicability of the linear analysis and one needs nonlinear schemes. We make use of numerical lattice simulations to properly follow the nonlinear dynamics such as backreaction and rescattering which gives important contributions to the emission of gravitational waves. It turns out that the axion with the decay constant f1016 GeV and the mass m10-14 eV which gives the correct dark matter abundance predicts the circularly polarized gravitational-wave signature detectable by SKA. We also show that the resulting gravitational-wave spectrum has a potential to explain NANOGrav 12.5 yr data.