A complete set of azoles undergoing 1,2-proton transfer, consisting of pyrazole, 1,2,3-triazole, 1,2,4-triazole, tetrazole and pentazole, was computationally investigated regarding proton transfer mechanism in gas phase and water solution. Complexes of one azole molecule with 1-4 water molecules were employed to facilitate the proton transfer by lowering the activation energy, which for the isolated azole molecule is prohibitively large. The calculations were performed at the MP2/aug-cc-pVDZ and B3LYP/6-311??G(d,p) levels of theory which showed very good concordance. It follows that in the most probable transition state one azole molecule is accompanied by two water molecules. The activation barrier in water solution modelled by PCM method was lowered to 18.8 kcal/mol in the case of pyrazole and more for azoles containing more nitrogen atoms in the ring, reaching 6.8 kcal/mol in the case of pentazole. The analysis of the IRC reaction paths showed that proton transfer in the gas phase has more synchronous character and in the water solution is rather stepwise. It also follows from the analysis of bond lengths in the transition state that in the case of pyrazole the transition state is more cation-like and for other azoles, especially pentazole, is more anion-like. In the water environment, the initial step of proton transfer is moving the proton from azole to the water cluster in all cases except pyrazole, where the proton moves first from the water cluster to the azole molecule.