For questions about the synthesis, properties, and reactions of ester compounds, both organic and inorganic.

Esters are chemical compounds derived from an acid (organic or inorganic) in which at least one $\ce{-OH}$ group is replaced by an $\ce{-O-alkyl}$ group.

Carboxylate esters:
The most common type of ester is a carboxylate ester. Carboxylate esters are any compounds containing the $\ce{RCOOR}$ group such as ethyl ethanoate:

enter image description here

Carboxylate esters are relatively polar molecules and are able to act as hydrogen bond acceptors through their oxygen atoms, which makes them useful as solvents. Many carboxylate esters smell fruity and they are widely used for this purpose in industry. They are also useful as protecting groups for carboxylic acids.

Carboxylate esters are usually prepared by refluxing an alcohol with a carboxylic acid in the presence of a strong, dehydrating acid catalyst such as sulfuric acid (Fischer esterification). They may also be prepared by using an acid anhydride or an acid chloride instead of a carboxylic acid, which is an irreversible reaction and so provides better yields at the cost of using more expensive and more dangerous reactants.

Carboxylate esters undergo addition of nucleophiles at the carbonyl carbon. When the nucleophile is hydroxide or water, this leads to ester hydrolysis, reforming the parent carboxylic acid and alcohol (or carboxylate salt if done under basic conditions). When the nucleophile is an alkoxide or alcohol, another ester is formed (transesterification) with a different alkyl group attached to the ester oxygen. The $\alpha$ hydrogen of carboxylate esters is mildly acidic and, in the presence of strong bases, carboxylate esters will undergo reactions at the $\alpha$ carbon yielding useful products such as $\beta$-ketoesters (Claisen condensation)

Compounds with multiple carboxylic acid and alcohol groups can undergo condensation polymerisation to form polyesters, which are widely used in clothing and various plastic goods.

Orthoesters:
The other main type of organic ester is the orthoester, which consists of three $\ce{-O-alkyl}$ groups bonded to the same carbon. An example is ethylorthoacetate (1,1,1-triethoxyethane in IUPAC nomenclature), so named because it is derived from ethylacetate.

enter image description here

Orthoesters can be prepared by reaction of nitriles with excess alcohol under acidic conditions (Pinner reaction) but can also easily be hydrolysed under mild acidic conditions to form esters, and this is the basis of their use as protecting groups for esters in organic synthesis.

Inorganic esters:
Less commonly, esters can be formed from inorganic acids such as phosphoric, sulfuric, nitric and chromic acids. They can all be formed by reacting the respective acids with an alcohol, in much the same way as carboxylate esters are prepared. Nitrate esters are used in explosives such as nitroglycerin, which has three nitrate ester groups:

enter image description here

Sulfate esters, such as sodium lauryl sulfate, are used as anionic surfactants due to the highly polar sulfate group which contrasts with the apolar hydrocarbon chain attached to it, making one end of the ion hydrophilic and the other hydrophobic.

enter image description here