The Fermi level of the topological insulators (TIs) Bi2Se3 and Bi2Te3 is usually well above the Dirac points, which is ascribed to the intrinsic donor defects, such as antisites and anion vacancies. We show here by first-principles calculations that the substrates can modulate the Fermi level of TIs considerably. It is found that in Bi2Se3/graphene and Bi2Te3/Si(1 1 1), the substrates play the role of electron donor due to their lower workfunctions and push up the Fermi level of the TIs. Thicker TI films are found to have larger density of states and hence the charge transferred to TI leads to a smaller Fermi level shift, in good agreement with experiments. We propose to use high workfunction substrates to counterbalance the upward shift of the Fermi level due to the donor defects. Our calculations found that the fluorinated substrates F-graphene and F-Si(1 1 1) have very high workfunction and become electron acceptors, leading to a downward shift of the Fermi level of TIs.