The crystal structure of sodium chloride, NaCl, a typical ionic compound. The purple spheres represent sodium cations, Na+, and the green spheres represent chloride anions, Cl.

In chemistry, an ionic compound is a chemical compound composed of ions held together by electrostatic forces termed ionic bonding. The compound is neutral overall, but consists of positively charged ions called cations and negatively charged ions called anions. These can be simple ions such as the sodium (Na+) and chloride (Cl) in sodium chloride, or polyatomic species such as the ammonium (NH+
) and carbonate (CO2−
) ions in ammonium carbonate. Individual ions within an ionic compound usually have multiple nearest neighbours, so are not considered to be part of molecules, but instead part of a continuous three-dimensional network, usually in a crystalline structure.

Ionic compounds containing basic ions hydroxide (OH) or oxide (O2−) are classified as bases. Ionic compounds without these ions are also known as salts and can be formed by acid–base reactions. Ionic compounds can also be produced from their constituent ions by evaporation of their solvent, precipitation, freezing, a solid-state reaction, or the electron transfer reaction of reactive metals with reactive non-metals, such as halogen gases.

Ionic compounds typically have high melting and boiling points, and are hard and brittle. As solids they are almost always electrically insulating, but when melted or dissolved they become highly conductive, because the ions are mobilized.