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)?

Please explain!