Aliphatic and aromatic cyclic imides have been prepared in high to moderate yields from cyclic carboxylic anhydrides or corresponding dicarboxylic acids, using formamide as reagent at 170-180 C for 5-6 hours. In the case of aromatic products with lower solubility in formamide, we used N-methyl-2-pyrrolidinone (NMP) as supplementary solvent, which facilitates the reaction.