Steel is an important material and has been widely used in today's industrial production. Using organic corrosion inhibitors is an effective means to prevent steel from corrosion. Generally, the molecular structures of inhibitors can have a major impact on their corrosion inhibition efficiency. In this work, the influence of alkyl chain length of three alkyltriazoles on the corrosion inhibition of iron has been investigated by density functional based tight binding (DFTB) approach. Several typical descriptors such as frontier molecular orbital, adsorption energy, density of states have been discussed in detail. Our findings will contribute to the understanding of the inhibition mechanism and the designing of novel corrosion inhibitors.