A facile and efficient protocol for the synthesis of xanthenedione and acridinrdione derivatives has been developed via the one-pot condensation reaction between dimedone and aldehydes (for the synthesis of xanthenediones) and dimedone, aldehydes and primary amines (for the synthesis of acridinediones) in presence of the formic acid as solvent at room temperature. All the products were obtained in good to excellent yields and all reactions were completed in short times.