An ion is an atom or molecule in which the total number of electrons is unequal to the total number of protons, which results in an electrical charge. The greater the imbalance in the protons and neutrons, the greater the charge.

A positively charged ion (containing more protons than electrons) is called a cation, while a negatively charged ion (containing fewer protons than electrons) is called an anion. Because they have opposite charge, cations and anions will attract, and ions having the same charge will naturally repel.