The process of phosphorylating a chemical compound either by reaction with inorganic phosphate or by transfer of phosphate from another organic phosphate; especially the enzymatic conversion of carbohydrates into their phosphoric esters in metabolic processes (as the conversion of glucose to glucose-6-phosphate by ATP and hexokinase).