Dimethyl ether (DME) carbonylation is considered as a key step for a promising route to produce ethanol from syngas. Heteropolyacids (HPAs) are proved to be efficient catalysts for DME carbonylation. In this work, the reaction mechanism of DME carbonylation was studied theoretically by using density functional theory calculations on two typical HPA models (HPW, HSiW). The whole process consists of three stages: DME dissociative adsorption, insertion of CO into methoxyl group and formation of product methyl acetate. The activation barriers of all possible elementary steps, especially two possible paths for CO insertion were calculated to obtain the most favorable reaction mechanism and rate-limiting step. Furthermore, the effect of the acid strength of Bronsted acid sites on reactivity was studied by comparing the activation barriers over HPW and HSiW with different acid strength, which was determined by calculating the deprotonation energy, Mulliken population analyses and adsorption energies of pyridine.