Both formic acid and carbonic acid contain two hydrogen atoms. Why is the chemical formula of formic acid written HCHO₂ (with the two hydrogen atoms listed separately), while the chemical formula of carbonic acid is written H₂CO₃ (with the two hydrogen atoms written together)?
That is because one of the Hydrogens of Formic acid is a part of the functional group (COOH). so to make sure the reader understands that, they second H is written separately