carl wilhelm scheele was the first who could extract citric acid from lemons, in 1782. the substance was probably known to alchemists, perhaps with a different name. the arabian alchemist geber is said to have discovered citric acid in the 9th century. citric acid contains 6 carbon atoms, 8 hydrogen atoms and 7 oxygen atoms. its chemical formula is c6h8o7.