How to Write Chemical Equations, Charges, and Subscripts Online
Complete reference for typing chemical formulas, ionic charges, reaction equilibrium arrows, and organic structures in web documents, Word, and mhchem LaTeX.
Writing chemistry formulas on computers has historically been notoriously frustrating. Between stoichiometric coefficients, elemental abbreviations, subscripted stoichiometric counts, superscripted ionic charges, and diverse reaction arrows, chemical notation violates the linear typing rules of standard word processors.
Whether you are a chemistry student submitting laboratory reports, an educator preparing classroom handouts, or a researcher writing academic manuscripts, this guide explains how to format flawless chemical equations across LaTeX, Microsoft Word, Google Docs, and web browsers.
1. Anatomy of a Rigorous Chemical Equation
A scientifically valid chemical equation provides qualitative and quantitative accounting of matter during a transformation. Consider the neutralization of sulfuric acid by sodium hydroxide:
H₂SO₄(aq) + 2NaOH(aq) → Na₂SO₄(aq) + 2H₂O(l)
Notice the structural elements that must be maintained:
- Upright Roman Font: Element abbreviations ($H, S, O, N a$) must never be italicized. In academic typesetting, italics are reserved for mathematical variables and physical quantities (e.g., mass $m$, temperature $T$, pressure $P$).
- Stoichiometric Coefficients: Full-size numerals placed immediately before formulas (e.g., the
2before $\text{NaOH}$). - Subscripts: Small numerals placed below the baseline indicating atom counts within a molecular unit (e.g., the
2and4in $\text{H}_2\text{SO}_4$). - Phase States: Lowercase abbreviations in parentheses indicating physical state: solid $(s)$, liquid $(l)$, gas $(g)$, or aqueous $(aq)$.
2. Formatting Subscripts, Superscripts & Ionic Charges
IUPAC Rules for Ionic Charges
According to the International Union of Pure and Applied Chemistry (IUPAC), ionic charges must be placed as superscripts following the chemical formula. Crucially:
- For polyvalent ions, the number precedes the sign: write $\text{Fe}^{3+}$ and $\text{SO}_4^{2-}$, not $\text{Fe}^{+3}$ or $\text{SO}_4^{-2}$ (the latter is notation reserved for formal oxidation states).
- For monovalent ions, the numeral 1 is omitted: write $\text{Na}^+$ and $\text{Cl}^-$, not $\text{Na}^{1+}$.
Unicode Subscripts and Superscripts
When typing in plain text environments that do not support rich-text formatting (such as WhatsApp, Discord, email subjects, or code comments), you can utilize native Unicode characters:
| Category | Unicode Glyphs | Example Output |
|---|---|---|
| Subscripts (0-9) | ₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ | C₆H₁₂O₆ (Glucose) |
| Superscripts (+, -, numbers) | ⁺ ⁻ ⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ | Ca²⁺, Al³⁺, PO₄³⁻ |
| Subscript Parentheses | ₍ ₎ | Fe₂(SO₄)₃ |
3. Types of Reaction Arrows
In chemistry, different arrows signify completely different energetic and mechanistic phenomena. Using the wrong arrow is a severe scientific error:
| Arrow Type | Glyph | Unicode | LaTeX Syntax | Chemical Meaning |
|---|---|---|---|---|
| Forward Reaction | → | U+2192 | \rightarrow or -> | Irreversible or stoichiometric completion reaction |
| Dynamic Equilibrium | ⇌ | U+21CC | \rightleftharpoons or <=> | Reversible reaction at dynamic equilibrium |
| Resonance Arrow | ↔ | U+2194 | \leftrightarrow or <-> | Delocalized electrons between resonance contributors |
| Precipitate | ↓ | U+2193 | \downarrow or v | Insoluble solid precipitate falling out of solution |
| Gas Evolution | ↑ | U+2191 | \uparrow or ^ | Gaseous product bubbling out of reaction vessel |
| Curved Arrow (Mechanism) | ↷ | U+2937 | tikz-cd or chemfig | Electron pair transfer in reaction mechanisms |
4. Phase State Notations (s, l, g, aq)
States of matter provide critical thermodynamic context for enthalpy, entropy, and Gibbs free energy calculations ($\Delta H^\circ, \Delta S^\circ, \Delta G^\circ$):
(s)— Solid (e.g., $\text{NaCl}(s)$)(l)— Pure liquid (e.g., $\text{H}_2\text{O}(l)$, $\text{Br}_2(l)$)(g)— Gas (e.g., $\text{CO}_2(g)$, $\text{O}_2(g)$)(aq)— Aqueous solution dissolved in water (e.g., $\text{CuSO}_4(aq)$)
Always format state symbols in upright lowercase characters, enclosed in parentheses, without extra spacing between the formula and the state symbol.
5. LaTeX mhchem Package Syntax
If you write scientific papers in LaTeX or Overleaf, never use standard math mode for chemistry. Instead, load the industry-standard mhchem package in your preamble:
\usepackage[version=4]{mhchem}The \ce{...} macro parses natural chemical syntax effortlessly:
% Simple water synthesis
\ce{2H2 + O2 -> 2H2O}
% Complex acid-base dissociation with equilibrium
\ce{CH3COOH(aq) + H2O(l) <=> CH3COO-(aq) + H3O+(aq)}
% Precipitation reaction with states
\ce{AgNO3(aq) + NaCl(aq) -> AgCl(s) v + NaNO3(aq)}
% Complex coordination complex
\ce{[Fe(CN)6]^4-}
% Reaction with heat or catalyst over the arrow
\ce{2KClO3 ->[\Delta][\ce{MnO2}] 2KCl + 3O2 ^}mhchem automatically differentiates capital element letters, places numbers into subscripts, elevates charges into superscripts, and centers catalyst annotations above reaction arrows.
6. Writing Chemistry in Word, Google Docs & Web Forms
In Microsoft Word:
- To make text subscript: Highlight the number and press Ctrl + =.
- To make text superscript: Highlight the charge and press Ctrl + Shift + +.
- In Word Equation Mode (Alt + =), type
\ceor format variables upright with double quotes:"H"_2"O".
In HTML Web Pages:
HTML provides semantic tags:
<!-- Subscripts for atoms, Superscripts for charges -->
<p>Ca<sup>2+</sup> + 2Cl<sup>-</sup> → CaCl<sub>2</sub></p>7. Complex Examples: Redox & Acid-Base Equilibria
In electrochemistry, half-reactions must balance both mass and electric charge. Consider the reduction of permanganate in acidic solution:
\ce{MnO4- + 8H+ + 5e- -> Mn^2+ + 4H2O}Notice how electrons are represented as $\text{e}^-$. The net charge on the left $(-1 + 8 - 5 = +2)$ exactly balances the net charge on the right $(+2 + 0 = +2)$.
8. Typing Chemistry Faster with Symbols Keyboard
Need to quickly assemble chemical reactions without writing lines of LaTeX code? Visit our free web-based Chemistry Keyboard. It features instant buttons for common polyatomic ions ($\text{SO}_4^{2-}$, $\text{NO}_3^-$, $\text{PO}_4^{3-}$), equilibrium arrows ($\rightleftharpoons$), state abbreviations, and Unicode sub/superscript digits.
You can also visualize 3D molecular bonds using our Molecular Bonding Visualizer to see hybridization angles and dipole moments in real time.
Frequently Asked Questions
How do I type a chemical subscript like H₂O on a standard keyboard without formatting?
You can use native Unicode subscript numbers (₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉). In Windows or mobile apps, you can copy them from our Chemistry Keyboard or use HTML <sub> tags (H<sub>2</sub>O) in web environments.
What is the proper arrow for dynamic chemical equilibrium?
Dynamic equilibrium should be represented by the harpoon arrow pair (⇌, Unicode U+21CC, LaTeX \rightleftharpoons), showing reversible forward and reverse reactions. Do not use the double-headed resonance arrow (↔), which has a strictly different meaning in molecular orbital theory.
How do I format ionic charges like Ca²⁺ or SO₄²⁻?
Standard IUPAC convention places the magnitude before the sign (e.g., 2+ rather than +2), typeset as a superscript. In Unicode: Ca²⁺ and SO₄²⁻. In HTML: Ca<sup>2+</sup> and SO<sub>4</sub><sup>2-</sup>. In LaTeX mhchem: \ce{Ca^2+} and \ce{SO4^2-}.
Why is LaTeX's \ce{...} command from mhchem superior to standard math mode for chemistry?
In standard LaTeX math mode, letters are automatically rendered in italic variables (making H2O look like H multiplied by 2 multiplied by O). The mhchem package automatically formats element symbols in upright roman font, recognizes stoichiometric coefficients, places subscripts and superscripts at correct baselines, and formats equilibrium arrows seamlessly.