We investigate the type of dual superconductivity responsible for quark confinement. For this purpose, we solve the field equations of the U(1) gauge-scalar model to obtain a single static vortex solution in the whole range without restricting to the long-distance region. Then we use the resulting magnetic field of the vortex to fit the gauge-invariant chromoelectric field connecting a pair of quark and antiquark which was measured by numerical simulations for SU(2) Yang–Mills theory on a lattice. This result improves the accuracy of the fitted value for the Ginzburg–Landau parameter to reconfirm the type I dual superconductivity for quark confinement which was claimed by preceding works based on the fitting using the Clem ansatz. Moreover, we calculate the Maxwell stress tensor to obtain the distribution of the force around the flux tube. This result suggests that the attractive force acts among chromoelectric flux tubes, in agreement with the type I dual superconductivity.