The invention relates to a process for preparing L-ofloxacin and ofloxacin which consists of, charging solution into 2-(2,3,4,5-tetrafluorobenzoyl-3-ethoxy-ethyl acrylate crude product, freezing, dropping L-amino propanol or DL-amino propanol, thermal insulating till the completion of conversion, alkalizing, reacting at the temperature of 50-90 deg. C, charging N-methyl piperazine into mother liquor, stirring for reaction 1-3 hours at 55-95 deg. C, decompressing and reclaiming N-methyl piperazidine, thermal insulating, plunging reaction liquor into water, agitating, cooling down and filtering, charging water and acid into filtrate, stirring, inversing flow till the completion of hydrolysis, adjusting the pH=7.0 with alkali liquor, extracting by adding in solvent extraction reagent, and concentrating the extract layer.