We performed full binary evolution calculations and carried out binary population synthesis studies in order to investigate the formation of subdwarf B (sdB) stars via the channels of stable Roche lobe overflow (RLOF), common envelope ejection and helium white dwarf mergers. Our model is successful in the explanation of observational properties of sdB stars, e.g. we explained the orbital period – minimum companion mass (log P – M
comp) diagram, the effective temperature – surface gravity (T
eff – log g) diagram, the orbital period distribution, the log(gθ
4) (θ = 5040/T
eff) distribution, the mass function distribution, the binary fraction of sdB stars, the fraction of sdB binaries with WD companions, the birth rates, the space number densities, etc. We conclude that (a) the first RLOF needs to be more stabilized than commonly assumed, (b) the first stable RLOF is not conservative, (c) common envelope ejection is very efficient.