The general formula for a carboxylic acid is typically written as RCOOH\mathrm{RCOOH}RCOOH or more explicitly as CnH2n+1COOH\mathrm{C_nH_{2n+1}COOH}CnH2n+1COOH, where R\mathrm{R}R represents an alkyl group or hydrocarbon chain. This means the molecule contains a carboxyl functional group −COOH-COOH−COOH attached to a hydrocarbon chain. The carbon atom in the −COOH-COOH−COOH group is counted within the total number of carbon atoms in the molecule. For example, the molecular formula for a carboxylic acid with 4 carbon atoms (butanoic acid) is C3H7COOH\mathrm{C_3H_7COOH}C3H7COOH, and sometimes simply written as C4H8O2\mathrm{C_4H_8O_2}C4H8O2. The first four carboxylic acids and their formulas are:
- Methanoic acid (formic acid): HCOOH\mathrm{HCOOH}HCOOH
- Ethanoic acid (acetic acid): CH3COOH\mathrm{CH_3COOH}CH3COOH
- Propanoic acid: CH3CH2COOH\mathrm{CH_3CH_2COOH}CH3CH2COOH
- Butanoic acid: CH3(CH2)2COOH\mathrm{CH_3(CH_2)_2COOH}CH3(CH2)2COOH