The synthesis of some 1,3-diazoles and thiazoles was realized in different conditions: a) In the presence of PTSA or sulfuric acid as catalyst we obtained only diazole products(4 a-d ).b) In basic medium such as DABCO or sodium hydroxide and ionic liquid afforded thiazoles. c) Both products, diazoles and thiazoles were collected when using methanol as catalyst and solvent.All structures were confirmed by IR, 1 H NMR and 13 C NMR spectroscopy. The antibacterial activity of some synthesized compounds was investigated against Escherichia Coli (ATCC: 25922) and Serratia marcescens (ATCC: 13880) as gram negative bacteria, Bacillus sabtilis (ATCC: 6633) and Staphylococcus aureus (ATCC: 6338) as gram positive bacteria. Some of these products exhibit good activities to significant antibacterial activity.