A chemical formula is any of several kinds of notation for expressing the composition and structure of a chemical compound. Chemical formulas use element symbols for the atoms of each chemical element in a compound. There are several conventional types of chemical formula that present different levels of detail.
An empirical formula is a type of chemical formula that shows the proportions of each chemical element by writing a subscripted whole number for each element symbol, such as for butane, which indicates that butane contains carbon and hydrogen atoms in a 2:5 ratio. Different compounds can share the same empirical formula, such as for most carbohydrates.
A molecular formula is a type of chemical formula that shows the number of atoms of each element contained in a molecule of a compound by writing the number as a subscript for each element symbol, such as for butane. There are conventions for the order of the elements, such as the Hill system, to assist readability and to make sorted lists that are readily searched. Molecular formulas for classes of compounds and for polymers of variable length make use of variables, such as in for the linear alkanes.
A structural formula is a type of chemical formula that shows the pattern of chemical bonds between the atoms, either as explicit lines between the element symbols, or as implied bonds in a notation that makes the bonding pattern clear. Full structural formulas (or "displayed formulas") show all atoms and bonds explicitly, as in the formula for butane pictured. A skeletal formula is a compact graphical notation in which element symbols for carbon (C) and hydrogen (H) are not shown and are implied by the pattern of bond lines.
A condensed formula is a type of structural formula that is written as a text string, such as for butane. Double (and higher-order) bonds are usually shown explicitly, and single bonds are sometimes shown for clarity, as in for propylene. Parentheses are used to enclose groups as needed to show the structure, as in for propylene glycol. Complex branched structures can be depicted by using nested parentheses, but cyclic structures, except for small pre-defined groups like phenyl (), cannot be represented as condensed formulas. Ionic compounds are depicted by sequentially writing the condensed formula for each strongly-bonded group of atoms, as in for ammonium sulfate, or as to show the electric charges of groups. Condensed formulas distinguish structural isomers, which are compounds having the same molecular formula but different connectivity. To distinguish stereoisomers, and to depict compounds that are too complex to represent as condensed formulas, graphical structural formulas such as skeletal formulas or perspective drawings are used.
The term line formula is ambiguous. Depending on context, it is used to mean a condensed formula, because it is written as a line of text, or to mean a displayed formula that shows all bonds as lines.
A crystal-chemical formula expresses the composition and some structural information for crystalline solids.
In addition to describing compounds, chemical formulas are used to describe chemical groups (such as the methyl group, ) classes of compounds (such as amines, ), and polymers (such as polyethylene, ). Formula types are sometimes intermixed, as in the use of a condensed formula to compactly denote a substituent in a skeletal formula.
Chemical formulas use element symbols and graphic symbols, in contrast to a chemical names, which use words. Chemical formulas are intended to be read by people, in contrast to text-string notations such as the SMILES and InChI, which specify chemical structures and can be manipulated by text editors but are intended to be generated and read mainly by computers.
Empirical formula
In chemistry, the empirical formula of a chemical is a simple expression of the relative number of each type of atom or ratio of the elements in the compound. Empirical formulas are the standard for ionic compounds, such as , and for macromolecules, such as . An empirical formula makes no reference to isomerism, structure, or absolute number of atoms. The term empirical refers to the process of elemental analysis, a technique of analytical chemistry used to determine the relative percent composition of a pure chemical substance by element.
For example, hexane has a molecular formula of , and (for one of its isomers, n-hexane) a structural formula , implying that it has a chain structure of 6 carbon atoms, and 14 hydrogen atoms. However, the empirical formula for hexane is . Likewise the empirical formula for hydrogen peroxide, , is simply , expressing the 1:1 ratio of component elements. Formaldehyde and acetic acid have the same empirical formula, . This is also the molecular formula for formaldehyde, but acetic acid has double the number of atoms.
Like the other formula types detailed below, an empirical formula shows the number of elements in a molecule, and determines whether it is a binary compound, ternary compound, quaternary compound, or has even more elements.
Non-stoichiometric compounds
Chemical formulas most often use integers for each element. However, there is a class of compounds, called non-stoichiometric compounds, that cannot be represented by small integers. Such a formula might be written using decimal fractions, as in , or it might include a variable part represented by a letter, as in , where x is normally much less than 1.
Molecular formula Molecular formulas indicate the numbers of atoms of each element in a molecule of a molecular substance. They are the same as the empirical formula for many molecules, and an integer multiple of the empirical formula for others. For water, the empirical and molecular formulas are both . An example in which they differ is glucose for which the empirical formula is (ratio 1:2:1), and the molecular formula is (number of atoms 6:12:6). A molecular formula provides more information about a molecule than its empirical formula, but is more difficult to establish.
Structural formula
In addition to indicating the number of atoms of each element in a molecule, a structural formula shows or implies the molecule's connectivity, which is the pattern of chemical bonds between the atoms. There are several types of structural formula, each emphasizing different aspects of the molecular structure.
The two diagrams show two molecules which are structural isomers of each other, since they both have the same molecular formula , but they have different structural formulas as shown.
Skeletal formula
A skeletal formula is a compact notation for a structural formula in which carbon (C) and hydrogen (H) atomic symbols are not shown and are implied by the pattern of bond lines.
Condensed formula
A condensed formula is a type of structural formula that uses a text string to represent the atoms and the arrangement of bonds between them. For example, ethane consists of two carbon atoms single-bonded to each other, with each carbon atom having three hydrogen atoms bonded to it. Its condensed formula is .
In ethylene there is a double bond between the carbon atoms (and thus each carbon only has two hydrogens), and the condensed formula may be written . The fact that there is a double bond between the carbons is implicit because the atoms are assumed to have the usual valence (number of bonds), with carbon having a valence of four. A more explicit form is to show the double bond directly , or less commonly . The two lines (or two pairs of dots) indicate that a double bond connects the two carbon atoms. A triple bond may be expressed with three lines () or three pairs of dots ().
Enclosing marks such as parentheses ( ) and square brackets [ ] are used to enclose groups to show the molecule's structure. Multiple identical atoms or functional groups bound to the same atom may expressed by writing the number of repetitions as a subscript. For example, isobutane may be written . Because condensed formulas represent the pattern of bonds between the atoms (their constitution), they distinguish structural isomers, molecules that have the same molecular formula but different structural formulas. For example, ethanol (condensed formula ) and dimethyl ether (condensed formula ) have different condensed formulas even though they have the same empirical and molecular formulas ().
Repeated functional groups that are bonded in sequence are also labeled with a number subscript, as in the shortened formula of n-butane, , where context and the convention that each element is assumed to have the usual valence determines whether the subscript means multiple groups on the same atom or sequentially bonded groups.
Condensed formulas are able to represent many chemical compounds including highly branched molecules, but they are not able to represent most cyclic compounds, with the exception of common pre-defined expressions that represent small cyclic groups such as phenyl (written , abbreviated Ph), which allows phenyl formate to be expressed as or .
Polymers and variable forms For polymers in condensed chemical formulas, parentheses or brackets are placed around the repeating unit. For example, a hydrocarbon molecule that is described as , is a molecule with fifty repeating units. If the number of repeating units is unknown or variable, a variable such as n may be used: .
A chemical formula used for a series of compounds that differ from each other by the number of repeated units is called a general formula. It generates a homologous series of chemical formulas. For example, a series of alcohols may be represented by the formula , giving the homologs methanol, ethanol, propanol, and so on.
Ions For ions, the electric charge on a particular atom may be denoted with a superscript. For example, has charge +1, and has charge +2. It is conventional to write +, 1+, 2+, 3+ etc. for positive charges, and −, 1−, 2−, 3− etc. for negative charges. The total charge on a charged molecule or a polyatomic ion may also be shown in this way, such as for hydronium, , or sulfate, . Displaying charges in a chemical formula is optional.
Brackets [ ] are often used to enclose an ionic formula, as in , which is found in compounds such as caesium dodecaborate, . Ionic compounds such as ammonium nitrate, , may show the charge for each ionic constituent, . In Hexamminecobalt(III) chloride, , the formula indicates that the ion contains six ammine groups () bonded to cobalt, and [ ] encloses the entire formula of the ion with charge +3. Specifying the charges here makes it clearer that the bond connecting the chlorines is ionic, rather than covalent.
Trapped atoms
The @ symbol (at sign) indicates an atom or molecule trapped inside a molecular cage but not chemically bound to it, as in an endohedral fullerene. For example, an atom M enclosed in buckminsterfullerene () is denoted .
Chemical names in answer to limitations of condensed formulas
The alkene called but-2-ene has two isomers, which the chemical formula does not identify. The relative position of the two methyl groups must be indicated by additional notation denoting whether the methyl groups are on the same side of the double bond (cis or Z) or on the opposite sides from each other (trans or E).