Chemical formula writer: criss-cross valencies, names and formula unit mass

Pick a positive and a negative ion and watch their valencies cross over to make the formula, with brackets and simplifying explained, a picture of the charges balancing, the compound's name and its formula unit mass in rounded or exact atomic masses. Ends with fresh practice questions.

Keep it one tap away for everyday use.

Bookmark Formula writer?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Pick ions
  2. Cross over
  3. Formula
  4. Mass
Nothing is uploadedWorks offline once open

    Charges balance

    Formula unit mass

    Rounded masses (H 1, C 12, O 16, Na 23, Cl 35.5 …) are the ones school books use. IUPAC standard atomic weights are more exact. The mass of one formula unit in u is the same number as the mass of one mole in grams.

    Try this

    • Make sodium chloride, then magnesium oxide. Both are 1 : 1, but for different reasons. Look at step 3.
    • Make calcium hydroxide. Why does OH get a bracket, but Cl in calcium chloride does not?
    • Compare iron(II) oxide and iron(III) oxide. Same elements, different formulas.
    • Build aluminium sulfate and count the atoms: how many oxygen atoms are in one formula unit?
    • Find a pair whose formula unit mass is exactly 100 u with rounded masses.

    Check yourself

      What it does

      An ionic compound is made of positive ions (cations) and negative ions (anions) in just the right numbers for the charges to cancel. The quickest way to find those numbers is the criss-cross method: each ion’s valency becomes the other ion’s count. This page does it in front of you.

      • Pick a cation (such as sodium, calcium, aluminium, ammonium or iron(III)) and an anion (such as chloride, oxide, hydroxide, sulfate or phosphate). Each list shows the valency.
      • The picture shows the valencies crossing over. Below it, the formula appears with its name and four short steps: write the valencies, cross them over, divide out any common factor, add brackets round groups that repeat.
      • Charges balance draws every positive and negative charge as a block, so you can see that, for example, two Al³⁺ (+6) exactly match three SO₄²⁻ (−6).
      • Formula unit mass adds up the atoms. The Class 9 setting uses rounded masses (H 1, O 16, Na 23, Cl 35.5 …); the Class 11 setting uses the exact IUPAC atomic weights.

      It follows Class 9 Science (atoms and molecules: ions, valency, writing chemical formulae, molecular mass and formula unit mass) and supports Class 10 and 11 Chemistry. See where the valencies come from in build an atom, then use your formulas in the equation balancer or turn them into moles with the mole bridge.

      How to use it

      1. Choose the positive ion and the negative ion.
      2. Read the formula, the name and the steps.
      3. Check the charge picture: the two rows of blocks are always the same length.
      4. Switch between rounded and exact masses to see the formula unit mass both ways.
      5. Try the Check yourself questions. Type formulas with normal digits, such as Ca(OH)2 or Al2(SO4)3.

      Worked example: aluminium sulfate

      Pick aluminium (Al, valency 3) and sulfate (SO₄, valency 2).

      1. Write the valencies: Al 3, SO₄ 2.
      2. Cross them over: Al gets 2, SO₄ gets 3.
      3. 2 and 3 have no common factor, so the ratio stays 2 : 3.
      4. Sulfate is a group of atoms that appears three times, so it goes in brackets: Al₂(SO₄)₃.

      Charges: 2 × (+3) = +6 and 3 × (−2) = −6.

      Formula unit mass with rounded masses: 2 × 27 + 3 × 32 + 12 × 16 = 54 + 96 + 192 = 342 u. With exact IUPAC weights it is 342.132 u.

      Now pick magnesium (2) and oxide (2). Crossing gives Mg₂O₂, and dividing by 2 gives MgO. That is why step 3 matters.

      Tips

      • Brackets only go round groups of atoms (polyatomic ions such as OH, NO₃, SO₄, CO₃, PO₄, NH₄), and only when there is more than one of them. Calcium chloride is CaCl₂, not Ca(Cl)₂.
      • Iron, copper and lead can have more than one valency. The Roman numeral in the name, as in iron(III) oxide, tells you which.
      • Formula unit mass is used for ionic compounds; molecular mass is the same sum for molecules such as H₂O or CO₂.

      FAQ

      Why does hydrogen with hydroxide give water? H⁺ and OH⁻ join to make H₂O, so the page shows water instead of “HOH”.

      Is anything saved? No. Everything runs in your browser and nothing is stored or sent.

      Is this an official textbook tool? No. It is an independent practice page that follows the same school topics.

      Where the numbers come from

      • Ion valencies and names: general chemistry facts (IUPAC naming with Roman numerals for iron, copper and lead), written fresh for fibub.
      • Rounded atomic masses as used in school books; exact values are the IUPAC/CIAAW standard atomic weights from fibub's shared element data.

      Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

      Read more on the Blog

      Last updated 2026-11-09.

      Change log for Formula writer

      1. Fix pictures in #1082, #1084, #1085, #1087, #1089, #1090 Details on GitHub
      2. Add #1084 Formula writer Details on GitHub

      Every change to fibub

      Related tools

      Equation balancer #T79 Balance any chemical equation, including ionic and redox ones, check the atoms on both sides, then find the limiting reagent, the theoretical yield, what is left over and your percent yield. Build an atom #L36 Tap to add protons, neutrons and electrons and watch the atom change: the element, atomic number, mass number, charge, isotope, the electrons filling shells 2, 8, 8 and the valency all update as you go. Ends with fresh practice questions. Mole bridge #L40 Type an amount of any substance in grams, moles, particles or litres of gas and see the other three, with the path across the mole bridge drawn and every step written out. Work out an empirical and molecular formula from percentages, and see which reactant runs out first. Ends with fresh practice questions. Reactivity series lab #L41 Drop a metal strip into a salt solution or dilute acid and see whether it displaces the other metal, with the balanced equation and what you would see. Your results fill a grid and build the series; tap any metal for its reactions with water and acid and how it is taken out of its ore. Ends with fresh practice questions. Oxidation number finder #L43 Type a formula such as K2Cr2O7 or SO4^2- and see the oxidation number of every element, which rule gave it and the sum that checks it. Then balance a redox reaction in acidic or basic solution by the half-reaction (ion-electron) method, step by step. Ends with fresh practice questions. Matter sorter #L106 Drag air, salt, brass, rust, tap water and more into Element, Compound and Mixture bins. A particle picture of each thing shows why it belongs where it does, and Class 9 splits mixtures into homogeneous and heterogeneous. Constant proportions #L145 Analyse samples of water, carbon dioxide, magnesium oxide and more from different sources and sizes on a virtual balance, and see the mass ratio of the elements stay the same. Class 11 adds the law of multiple proportions. Reaction type sorter #L172 Watch 20 well-known reactions play out as particle pictures, with atoms changing partners but never appearing or vanishing. Sort each one into combination, decomposition, displacement or double displacement, then see what you would observe and, for redox reactions, what is oxidised and what is reduced (Class 10 oxygen and hydrogen view or Class 11 oxidation numbers). Ionic bond builder #L175 Pick a metal and a non-metal and move their outer electrons one at a time, drawn as crosses and dots, until every ion has a full outer shell. See the charges, the shells of each ion, why MgCl₂ needs two chlorines, and the formula and name of the compound. Crystallisation water #L176 Heat blue copper sulfate, washing soda, Epsom salt, gypsum and other hydrated crystals in a virtual crucible, weigh after each heating until the mass stops changing, and work out x in Salt·xH₂O from the water lost. Also finds x from your own three weighings. Nitrogen estimation #L224 Work out the percent nitrogen in an organic compound by the Dumas method (volume of N₂ gas reduced to STP, with aqueous tension) or the Kjeldahl method (ammonia caught in H₂SO₄ or HCl, by direct or back titration). Every step is shown with your numbers, beside a sketch of the apparatus and known compounds to compare.