6.2 Writing Formulas of Ionic Compounds

Learning Objectives

By the end of this section, you will be able to:

  • Define ionic compounds
  • Predict the type of compound formed from elements based on their location within the periodic table
  • Determine formulas for simple ionic compounds

Ionic Compounds

When an element composed of atoms that readily lose electrons (a metal) reacts with an element composed of atoms that readily gain electrons (a nonmetal), a transfer of electrons usually occurs, producing ions. The compound formed by this transfer is stabilized by the electrostatic attractions (ionic bonds) between the ions of opposite charge present in the compound. For example, when each sodium atom in a sample of sodium metal (group 1) gives up one electron to form a sodium cation, Na+, and each chlorine atom in a sample of chlorine gas (group 17) accepts one electron to form a chloride anion, Cl, the resulting compound, NaCl, is composed of sodium ions and chloride ions in the ratio of one Na+ ion for each Cl ion. Similarly, each calcium atom (group 2) can give up two electrons and transfer one to each of two chlorine atoms to form CaCl2, which is composed of Ca2+ and Cl ions in the ratio of one Ca2+ ion to two Cl ions.

A compound that contains ions and is held together by ionic bonds is called an ionic compound. The periodic table can help us recognize many of the compounds that are ionic: When a metal is combined with one or more nonmetals, the compound is usually ionic. This guideline works well for predicting ionic compound formation for most of the compounds typically encountered in an introductory chemistry course. However, it is not always true (for example, aluminum chloride, AlCl3, is not ionic).

You can often recognize ionic compounds because of their properties. Ionic compounds are solids that typically melt at high temperatures and boil at even higher temperatures. For example, sodium chloride melts at 801 °C and boils at 1413 °C. (As a comparison, the molecular compound water melts at 0 °C and boils at 100 °C.) In solid form, an ionic compound is not electrically conductive because its ions are unable to flow (“electricity” is the flow of charged particles). When molten, however, it can conduct electricity because its ions are able to move freely through the liquid (Figure 6.2a).

This figure shows three photos connected by right-facing arrows. The first shows a light bulb as part of a complex lab equipment setup. The light bulb is not lit. The second photo shows a substances being heated or set on fire. The third shows the light bulb again which is lit.
Figure 6.2a: Sodium chloride melts at 801 °C and conducts electricity when molten. (credit: modification of work by Mark Blaser and Matt Evans in  Chemistry (OpenStax), CC BY 4.0).

Watch Conductivity Molten Salt Video (51 seconds)

Video Source: Ashkenazi, G. (2012, November 15). Conductivity in molten salt [Video]. YouTube:

In every ionic compound, the total number of positive charges of the cations equals the total number of negative charges of the anions. Thus, ionic compounds are electrically neutral overall, even though they contain positive and negative ions. We can use this observation to help us write the formula of an ionic compound. The formula of an ionic compound must have a ratio of ions such that the numbers of positive and negative charges are equal.

Example 6.2a

Formation of Ions

Magnesium and nitrogen react to form an ionic compound. Predict which forms an anion, which forms a cation, and the charges of each ion. Write the symbol for each ion and name them.


Magnesium’s position in the periodic table (group 2) tells us that it is a metal. Metals form positive ions (cations). A magnesium atom must lose two electrons to have the same number electrons as an atom of the previous noble gas, neon. Thus, a magnesium atom will form a cation with two fewer electrons than protons and a charge of 2+. The symbol for the ion is Mg2+, and it is called a magnesium ion.

Nitrogen’s position in the periodic table (group 15) reveals that it is a nonmetal. Nonmetals form negative ions (anions). A nitrogen atom must gain three electrons to have the same number of electrons as an atom of the following noble gas, neon. Thus, a nitrogen atom will form an anion with three more electrons than protons and a charge of 3−. The symbol for the ion is N3−, and it is called a nitride ion.

Exercise 6.2a

Aluminum and carbon react to form an ionic compound. Predict which forms an anion, which forms a cation, and the charges of each ion. Write the symbol for each ion and name them.

Check Your Answer[1]

The ions that we have discussed so far are called monatomic ions, that is, they are ions formed from only one atom. We also find many polyatomic ions. These ions, which act as discrete units, are electrically charged molecules (a group of bonded atoms with an overall charge). Some of the more important polyatomic ions are listed in Table 6.2a. Oxyanions are polyatomic ions that contain one or more oxygen atoms.

Table 6.2a: Common Polyatomic Ions
Name Formula Related Acid Formula
ammonium [latex]\text{NH}_4^{\;\;+}[/latex]
hydronium [latex]\text{H}_3\text{O}^{+}[/latex]
oxide [latex]\text{O}_2^{\;\;-}[/latex]
peroxide [latex]\text{O}_2^{\;\;2-}[/latex]
hydroxide [latex]\text{OH}^{-}[/latex]
acetate [latex]\text{CH}_3\text{COO}^{-}[/latex] acetic acid [latex]\text{CH}_3\text{COOH}[/latex]
cyanide [latex]\text{CN}^{-}[/latex] hydrocyanic acid [latex]\text{HCN}[/latex]
azide [latex]\text{N}_3^{\;\;-}[/latex] hydrazoic acid [latex]\text{HN}_3[/latex]
carbonate [latex]\text{CO}_3^{\;\;2-}[/latex] carbonic acid [latex]\text{H}_2\text{CO}_3[/latex]
bicarbonate [latex]\text{HCO}_3^{\;\;-}[/latex]
nitrate [latex]\text{NO}_3^{\;\;-}[/latex] nitric acid [latex]\text{HNO}_3[/latex]
nitrite [latex]\text{NO}_2^{\;\;-}[/latex] nitrous acid [latex]\text{HNO}_2[/latex]
sulfate [latex]\text{SO}_4^{\;\;2-}[/latex] sulfuric acid [latex]\text{H}_2\text{SO}_4[/latex]
hydrogen sulfate [latex]\text{HSO}_4^{\;\;-}[/latex]
sulfite [latex]\text{SO}_3^{\;\;2-}[/latex] sulfurous acid [latex]\text{H}_2\text{SO}_3[/latex]
hydrogen sulfite [latex]\text{HSO}_3^{\;\;-}[/latex]
phosphate [latex]\text{PO}_4^{\;\;3-}[/latex] phosphoric acid [latex]\text{H}_3\text{PO}_4[/latex]
hydrogen phosphate [latex]\text{HPO}_4^{\;\;2-}[/latex]
dihydrogen phosphate [latex]\text{H}_2\text{PO}_4^{\;\;-}[/latex]
perchlorate [latex]\text{ClO}_4^{\;\;-}[/latex] perchloric acid [latex]\text{HClO}_4[/latex]
chlorate [latex]\text{ClO}_3^{\;\;-}[/latex] chloric acid [latex]\text{HClO}_3[/latex]
chlorite [latex]\text{ClO}_2^{\;\;-}[/latex] chlorous acid [latex]\text{HClO}_2[/latex]
hypochlorite [latex]\text{ClO}^{-}[/latex] hypochlorous acid [latex]\text{HClO}[/latex]
chromate [latex]\text{CrO}_4^{\;\;2-}[/latex] chromic acid [latex]\text{H}_2\text{CrO}_4[/latex]
dichromate [latex]\text{Cr}_2\text{O}_7^{\;\;2-}[/latex] dichromic acid [latex]\text{H}_2\text{Cr}_2\text{O}_7[/latex]
permanganate [latex]\text{MnO}_4^{\;\;-}[/latex] permanganic acid [latex]\text{HMnO}_4[/latex]

Note that there is a system for naming some polyatomic ions; -ate and -ite are suffixes designating polyatomic ions containing more or fewer oxygen atoms. Per- (short for “hyper”) and hypo- (meaning “under”) are prefixes meaning more oxygen atoms than -ate and fewer oxygen atoms than -ite, respectively. For example, perchlorate is ClO4, chlorate is ClO3, chlorite is ClO2 and hypochlorite is ClO. Unfortunately, the number of oxygen atoms corresponding to a given suffix or prefix is not consistent; for example, nitrate is NO3 while sulfate is SO42−. This will be covered in more detail in the next module on nomenclature.

As you encounter monoatomic and polyatomic ions in different compounds and solutions, it is important to think about the differences in these ions.  As was mentioned previously, monoatomic ions are simple in that these are formed when a single atom loses or gains a number of electrons. For example, a magnesium ion (Mg2+) is formed when a magnesium atom loses two electrons.  The atom that the ion is formed from as well as the charge of the ion is both represented in the formula.

Polyatomic ions are different in how we think about their formation and how we represent them.  Polyatomic ions are still charged particles so we must represent the charge in the formula, but as the name implies these ions are formed from more than one atom.  Let’s consider a sulfate (SO42-) ion as our example as illustrated in Figure 6.2b.  Using what we’ve learned in previous sections, we can see that there is one sulfur atom and four oxygen atoms and that there is a charge of -2.  The sulfur atom is bonded to the oxygen atoms with covalent bonds. All five of those atoms bonded together make up the polyatomic ion.

The image is a sulfate ion in a space-filled format where one yellow sulfur atom is in the center bonded to four red oxygen atoms.
Figure 6.2b: A space-filling image of a sulfate ion, where the S is represented by a yellow sphere and the oxygens are represented by red spheres. (credit: work by Benjah-bmm27, PD)

The 5-atom unit (1 x S, 4 x O) has an overall charge of -2.  (It is incorrect to think that the oxygen has a -2 charge OR the sulfur has a -2 charge) In general, the atoms of a polyatomic ions (and the associated overall charge) stay together whether you are writing the ion by itself or as a part of a formula.  This idea of keeping all of the atoms in a polyatomic together will be important when you learn about the dissociation of ionic compounds.

The nature of the attractive forces that hold atoms or ions together within a compound is the basis for classifying chemical bonding. When electrons are transferred and ions form, ionic bonds result. Ionic bonds are electrostatic forces of attraction, that is, the attractive forces experienced between objects of opposite electrical charge (in this case, cations and anions). When electrons are “shared” and molecules form, covalent bonds result. Covalent bonds are the attractive forces between the positively charged nuclei of the bonded atoms and one or more pairs of electrons that are located between the atoms. Compounds are classified as ionic or molecular (covalent) on the basis of the bonds present in them.

Example 6.2b

Predicting the Formula of an Ionic Compound

The gemstone sapphire (Figure 6.2c) is mostly a compound of aluminum and oxygen that contains aluminum cations, Al3+, and oxygen anions, O2−. What is the formula of this compound?

This is a photograph of a ring with a sapphire set in it.
Figure 6.2c: Although pure aluminum oxide is colourless, trace amounts of iron and titanium give blue sapphire its characteristic colour. (credit: modification of work by Stanislav Doronenko, CC BY 3.0)


Because the ionic compound must be electrically neutral, it must have the same number of positive and negative charges. Two aluminum ions, each with a charge of 3+, would give us six positive charges, and three oxide ions, each with a charge of 2−, would give us six negative charges. The formula would be Al2O3.

Exercise 6.2b

Predict the formula of the ionic compound formed between the sodium cation, Na+, and the sulfide anion, S2−.

Check Your Answer[2]

Many ionic compounds contain polyatomic ions (Table 6.2a) as the cation, the anion, or both. As with simple ionic compounds, these compounds must also be electrically neutral, so their formulas can be predicted by treating the polyatomic ions as discrete units. We use parentheses in a formula to indicate a group of atoms that behave as a unit. For example, the formula for calcium phosphate, one of the minerals in our bones, is Ca3(PO4)2. This formula indicates that there are three calcium ions (Ca2+) for every two phosphate (PO43−) groups. The PO43− groups are discrete units, each consisting of one phosphorus atom and four oxygen atoms, and having an overall charge of 3−. The compound is electrically neutral, and its formula shows a total count of three Ca, two P, and eight O atoms.

Example 6.2c

Predicting the Formula of a Compound with a Polyatomic Anion

Baking powder contains calcium dihydrogen phosphate, an ionic compound composed of the ions Ca2+ and H2PO4. What is the formula of this compound?


The positive and negative charges must balance, and this ionic compound must be electrically neutral. Thus, we must have two negative charges to balance the 2+ charge of the calcium ion. This requires a ratio of one Ca2+ ion to two H2PO4 ions. We designate this by enclosing the formula for the dihydrogen phosphate ion in parentheses and adding a subscript 2. The formula is Ca(H2PO4)2.

Exercise 6.2c

Predict the formula of the ionic compound formed between the lithium ion and the peroxide ion, O22− (Hint: Use the periodic table to predict the sign and the charge on the lithium ion.)

Check Your Answer[3]

Because an ionic compound is not made up of single, discrete molecules, it may not be properly symbolized using a molecular formula. Instead, ionic compounds must be symbolized by a formula indicating the relative numbers of its constituent ions. For compounds containing only monatomic ions (such as NaCl) and for many compounds containing polyatomic ions (such as CaSO4), these formulas are just the empirical formulas introduced earlier in the book. However, the formulas for some ionic compounds containing polyatomic ions are not empirical formulas. For example, the ionic compound sodium oxalate is comprised of Na+ and C2O42− ions combined in a 2:1 ratio, and its formula is written as Na2C2O4. The subscripts in this formula are not the smallest-possible whole numbers, as each can be divided by 2 to yield the empirical formula, NaCO2. This is not the accepted formula for sodium oxalate, however, as it does not accurately represent the compound’s polyatomic anion, C2O42−.

Attribution & References

Except where otherwise noted, this page is adapted by Adrienne Richards and Samantha Sullivan Sauer from “3.7 Molecular and Ionic Compounds” In General Chemistry 1 & 2 by Rice University, a derivative of Chemistry (Open Stax) by Paul Flowers, Klaus Theopold, Richard Langley & William R. Robinson and is licensed under CC BY 4.0. ​Access for free at Chemistry (OpenStax)

  1. Al will form a cation with a charge of 3+: Al3+, an aluminum ion. Carbon will form an anion with a charge of 4−: C4−, a carbide ion.
  2. Na2S
  3. Li2O2


Icon for the Creative Commons Attribution 4.0 International License

Enhanced Introductory College Chemistry Copyright © 2023 by Gregory Anderson; Caryn Fahey; Jackie MacDonald; Adrienne Richards; Samantha Sullivan Sauer; J.R. van Haarlem; and David Wegman is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book