The conversion of the biomass into high value-added chemicals is an attractive topic in green chemistry. In this work, we studied the synthesis of 2,6-deoxyfructosazine (2,6-DOF) and 2,5-deoxyfructosazine (2,5-DOF) from cellobiose and inulin, respectively, in aqueous solution by an one-pot two-step route. In this method, cellobiose or inulin was first hydrolyzed into glucose or fructose and then reacted directly with ammonium formate to form 2,6-DOF or 2,5-DOF. The effects of reaction temperature, reaction time, pH value on the yields of the products were studied. It was demonstrated that the cellobiose and inulin could be converted to 2,6-DOF and 2,5-DOF effectively at optimized condition.