There are two common methods for writing chemical formulas.
Explanation:Method 1
Many chemists use the Hill system for writing chemical formulas,
There are two rules:
This gives us formulas like CH4 and H2O.
This system is unambiguous and is used in most chemical databases and printed indexes to sort lists of compounds.
Method 2
Another common system puts the more positive elements in compound first.
This gives us formulas like H2O, NaCl, and H2SO4 (not ClH or H2O4S).
In practice, most chemists use Method 1 for organic compounds and Method 2 for inorganic compounds.
Nevertheless, it is permissible to depart from either method if you want to make a specific point.