A facile one-pot synthesis of ethyl 5-methyl-4,7-dihydrotetrazolo[1,5-a]pyrimidine, 5-tert-butyl-4,7-dihydrotetrazolo[1,5-a]pyrimidine, 6,6-dimethyl-5,6,7,9-tetrahydrotetrazolo[5,1-b]quinazolin-8(4H)-one and 5,6,7,9-tetrahydrotetrazolo[5,1-b]quinazolin-8(4H)-one derivatives were described via a three-component reaction of aldehyde, 5-aminotetrazole and diketones in PEG-400 under microwave irradiation at 110 °C for 30 min. A wide range of diketones such as ethylacetoacetate, tert-butyl acetoacetate, 5,5-dimethylcyclohexane-1,3-dione and 1,3-cyclohexanedione were utilized to carry out the synthesis of different dihydrotetrazolo[1,5-a]pyrimidines and tetrahydrotetrazolo[1,5-a]quinazolinones. This method has the advantage of green protocol, operational simplicity, high yields, recyclability of the solvent and involves isolation of the final product without column purification. The scope of this reaction tolerates with aromatic, heteroaromatic and alicyclic aldehydes.