The detached-binary channel is an important channel for the formation of contact binaries , according to which a detached binary might evolve into contact by evolutionary expansion of the components , or angular momentum loss through the effect of magnetic braking ( MB ) . We have carried out a detailed binary population synthesis ( BPS ) study of this channel , and obtained the parameter regions for detached binaries to evolve into contact . Combining the observations from the Kepler satellite with our results , we found that the ratio of the birth rate of the progenitors of contact binaries to that of contact binaries is greater than about 1.2 . This suggests that for the detached-binary channel , the progenitors can be sufficient to produce observed contact binaries . In this channel , we find that the distribution of orbital period for contact binaries has a peak at about 0.25 days and a tail extending to longer periods , and the formation timescale of contact binaries has a large range from \sim 1 Myr to 15 Gyr . These results show that the detached-binary channel could explain satisfactorily the main observational characteristics of contact binaries , in particular the distribution of orbital period shown by the Kepler observations and the existence of very young contact binaries .