Oxygen difluoride was first prepared in 1929. It was made by the electrolysis of molten potassium fluoride and hydrofluoric acid. The chemicals had a small amount of moisture. Nowadays, it is prepared by the reaction of fluorine with a dilute aqueous solution of sodium hydroxide. Sodium fluoride is left as a side-product: