Build a formula

Tap atoms to write a chemical formula, and the page reads it back.

6 carbon, 12 hydrogen and 6 oxygen atoms: 24 atoms in all.

Two pages on this site share this formula: Fructose and Glucose. The same 24 atoms, joined differently, so the formula alone cannot tell them apart.

The 21 elements in this site’s 160 compounds.

Elements
What a tap does

Writing a formula needs JavaScript. The example above is complete, and every formula on this site is listed below.

  • C 6
  • H 12
  • O 6
Viewer controls

Drag to rotate; pinch or Ctrl + scroll to zoom. Arrow keys rotate, + − zoom, R resets.

24 atoms, 24 single bonds.
Ball-and-stick model of fructose: 6 carbon atoms, 12 hydrogen atoms and 6 oxygen atoms, 24 single bonds. Carbon is grey, hydrogen white, oxygen red.

Open fructose

Structural formula of fructose. Each unlabelled corner is a carbon atom, and the seven hydrogens on carbon are not drawn. Wedges come toward you, hashes go back. It shows which atoms are joined to which, not the shape. Structural formula of fructose, drawn flat from PubChem's 2D record: 6 carbon atoms, 12 hydrogen atoms and 6 oxygen atoms, 24 single bonds. Each unlabelled corner is a carbon atom, and the seven hydrogens on carbon are not drawn. One bond is drawn as a wedge toward the reader and two hashed, away from it. Symbols carry their usual colours: oxygen red. A structural formula shows how the atoms are joined, not the shape of the molecule.
Structural formula of glucose. Each unlabelled corner is a carbon atom, and the seven hydrogens on carbon are not drawn. Wedges come toward you, hashes go back. It shows which atoms are joined to which, not the shape. Structural formula of glucose, drawn flat from PubChem's 2D record: 6 carbon atoms, 12 hydrogen atoms and 6 oxygen atoms, 24 single bonds. Each unlabelled corner is a carbon atom, and the seven hydrogens on carbon are not drawn. Two bonds are drawn as wedges toward the reader and two hashed, away from it. Symbols carry their usual colours: oxygen red. A structural formula shows how the atoms are joined, not the shape of the molecule.

Formulas on this site

How to read a formula

A chemical formula records how many atoms of each kind are present in one unit of a compound. Each count is set as a subscript after its element symbol, and a single atom takes no number at all. A symbol is itself an abbreviation of one or two letters, O for oxygen, Cl for chlorine.

Where the symbols stand is a matter of convention, and this page writes them in the order you tap, because what it matches is the count and not the order. Tap oxygen and then two hydrogens and the glyph reads OH2, which still answers water. A compound page may print the same composition another way: acetic acid is CH3COOH there and C2H4O2 here.

The tiles hand out element symbols rather than atoms, on this evidence: methane forming from free gaseous atoms is a reaction nobody watches directly, and its energy is known from indirect evidence.

What a formula leaves out

The formulas we ordinarily write say nothing about structure: which atoms are bonded to which, or how they stand in space. Among organic compounds, hundreds of different molecules may share one empirical formula. Ethanol and dimethyl ether are such a pair, both written C2H6O, and their properties differ accordingly. What tells them apart is connectivity, the sequence in which their atoms are joined; a structural formula shows it and a plain formula does not.

When a formula is a ratio

Some solids are built as extended lattices that hold no separate molecules. Sodium chloride is the familiar case: each ion sits among six neighbours of opposite charge, and each of those among six more. The ion at the centre claims only a sixth of each chloride around it, so the composition still comes out one to one. No NaCl particle can be picked out of such a crystal, and the formula states a ratio rather than a count of a particle. Formulas of this kind give the relative numbers of the elements in the smallest whole numbers.

So this page matches an ionic formula by its ratio, and Na2Cl2 and Na3Cl3 both answer sodium chloride. A molecular formula it matches exactly, which is why H4O2 is not a second way of writing water.

Sources

  1. Stephen Lower, Chem1 General Chemistry, §4.3 Formulas and Their Meaning (LibreTexts, CC BY 3.0)
  2. Stephen Lower, Chem1 General Chemistry, §7.7 Ionic and Ion-Derived Solids (LibreTexts, CC BY 3.0)
  3. Stephen Lower, Chem1 General Chemistry, §9.1 Three Views of Chemical Bonding (LibreTexts, CC BY 3.0)
  4. Stephen Lower, Chem1 General Chemistry, §9.2 Molecules: Properties of Bonded Atoms (LibreTexts, CC BY 3.0)