The analytical micromagnetics and numerical simulations were used to investigate the domain wall structure during the magnetization reversal in nanowires. Micromagnetic analysis shows that the domain wall structure is mainly determined by the competition between the demagnetization energy and exchange energy. The wall with vortex magnetization structure in cross-section is energetically more favorable for wires with large diameter. With the reduction of diameter the exchange energy increases. At a critical diameter the vortex structure can not be sustained and the transition from vortex wall to transverse wall occurs. The critical diameters for this transition are about 40 nm for Ni wire and 20 nm for Fe wire, respectively. A series of micromagnetic simulations on the cone-shaped wire confirm the analytical results. The simulations also show that during the reversal process the vortex domain wall moves much faster than the transverse one.