StatGardenREF. DESK
Calculators/Chemistry/Ionic Calculator
Chemistry

Ionic Calculator calculator

The correct chemical formula of an ionic compound from a chosen cation and anion, by balancing charges.

Published 21 August 2026

What this calculator does

An ionic compound has to be electrically neutral overall, so the number of cations and anions in its formula is fixed by their charges, not chosen freely. This ionic equation calculator takes a cation and an anion, cross-multiplies their charges to find how many of each are needed, then reduces that ratio to its simplest whole-number form to give the correct formula.

The method, sometimes called the criss-cross method, is standard first-year chemistry: the cation’s charge becomes the anion’s subscript, the anion’s charge becomes the cation’s subscript, and the two are then divided by their greatest common factor. Polyatomic ions such as sulfate or ammonium get wrapped in parentheses when more than one is needed, so the subscript is clearly applied to the whole ion rather than to just its last atom.

The formula

FormulaCross-multiply the cation and anion charges as subscripts, then reduce both by their greatest common divisor

Take the absolute value of each ion’s charge. The cation’s subscript in the formula equals the anion’s charge, and the anion’s subscript equals the cation’s charge; that criss-cross always balances the total positive and negative charge. Both subscripts are then divided by their greatest common divisor so the formula is in lowest terms, and a subscript of 1 is dropped entirely, as is conventional.

TermMeaning
CationThe positively charged ion, normally a metal or the ammonium ion.
AnionThe negatively charged ion, normally a nonmetal or a polyatomic group.
SubscriptThe small number after an ion’s symbol showing how many of that ion are in the formula unit.
Polyatomic ionAn ion made of more than one atom, such as sulfate (SO4^2-) or ammonium (NH4+), written in parentheses when its subscript is greater than one.

The inputs explained

FieldWhat to enter
CationThe cation (positive ion) in the compound.
AnionThe anion (negative ion) in the compound.

When to use it

Checking homework or a lab write-up

Given a cation and anion pair, confirming the correct formula and subscripts is a quick check before writing it into a report or an equation that needs balancing.

Working from an unfamiliar transition metal

Transition metals such as iron or copper can form more than one charge state (Fe2+ or Fe3+, for instance), and picking the wrong one changes the formula entirely, so selecting the specific charge state removes the guesswork.

Learning the criss-cross method

Working through several cation and anion combinations side by side is one of the more direct ways to see why a 2+ cation paired with a 1- anion needs two of the anion, and why that pattern reverses for a 1+ cation with a 2- anion.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

What formula does calcium form with different anions?

Calcium held fixed against a range of common anions.

Calcium (Ca2+) paired with common anions
AnionCompound formulaCharge balance
ChlorideCaCl21 × (2+) + 2 × (1-) = 0
SulfateCaSO41 × (2+) + 1 × (2-) = 0
PhosphateCa3(PO4)23 × (2+) + 2 × (3-) = 0
HydroxideCa(OH)21 × (2+) + 2 × (1-) = 0
CarbonateCaCO31 × (2+) + 1 × (2-) = 0
Calcium is always 2+, so the subscript it picks up matches whatever charge the anion carries: 1 chloride needs two of them to balance one calcium, but phosphate at 3- needs three calciums to balance two phosphates, giving Ca3(PO4)2.

How does the same anion behave with different cations?

Chloride held fixed against a range of common cations.

Chloride (Cl-) paired with common cations
CationCompound formulaCharge balance
SodiumNaCl1 × (1+) + 1 × (1-) = 0
CalciumCaCl21 × (2+) + 2 × (1-) = 0
AluminiumAlCl31 × (3+) + 3 × (1-) = 0
Iron(II)FeCl21 × (2+) + 2 × (1-) = 0
Iron(III)FeCl31 × (3+) + 3 × (1-) = 0
Chloride is always 1-, so the number of chlorides needed simply matches the cation’s charge: one for sodium (1+), two for calcium (2+), and three for aluminium and iron(III) (both 3+).

Questions

How do you find the formula of an ionic compound?

Take the charge on the cation and the charge on the anion, use each one as the other ion’s subscript, then reduce that pair of subscripts by their greatest common factor. The result is the smallest whole-number ratio of ions that gives an electrically neutral formula unit.

Why does calcium chloride become CaCl2 and not Ca2Cl?

Calcium carries a 2+ charge and chloride carries a 1-, so it takes two chlorides to cancel out one calcium’s charge, not the other way around. The criss-cross method places the calcium’s charge, 2, as chloride’s subscript, giving CaCl2.

Why do some formulas use parentheses, like Ca(OH)2?

Parentheses show that the subscript applies to an entire polyatomic ion, not just to the last atom written. Ca(OH)2 means two whole hydroxide ions; without the parentheses, CaOH2 would misleadingly suggest two hydrogens attached to one oxygen.

What if the cation and anion have the same charge?

When the charges are equal, such as calcium (2+) and sulfate (2-), the criss-cross gives a subscript of 1 on each side, which is dropped by convention. The formula is simply CaSO4, with one of each ion.

To check whether the resulting compound actually dissolves in water, see the solubility rules calculator. For converting a known mass of a substance into moles, use the mole calculator.