We derived the influence of dark matter (DM) decays and annihilations on structure formation. The energy deposited by DM decays and annihilations into metal free halos both increases the gas temperature and enhances the formation of molecules. Within the primordial halos the temperature increase generally dominates over the molecular cooling, slightly delaying the collapse. In fact, the critical mass for collapse is generally higher than in the unperturbed case, when we consider the energy input from DM. In presence of DM decays and/or annihilations the fraction of baryons inside collapsed metal free halos should be slightly less (≈ 0.4) than the expected cosmological value