Writing a formula
Elements + subscripts: H_2SO_4, C_6H_12O_6
A single-page reference for every construct AsciiChem can encode. Print it, bookmark it, or scan it before writing chemistry.
| Construct | Syntax | Example | Notes |
|---|---|---|---|
| Element symbol | Capital + optional lowercase | H, He, Uue | One or two letters |
| Subscript (multiplicity) | _N after atom | H_2, H_2O | Binds to preceding atom |
| Multi-char subscript | _{...} | H_{2a} | Braces for non-numeric |
| Stoichiometric coefficient | Leading digits | 2H_2O, 3H_2 | Distinct from subscript |
HHeH_2H_2OC_6H_12O_62H_2O| Construct | Syntax | Example | Notes |
|---|---|---|---|
| Prefix isotope | ^N before atom | ^14C, ^238U | Binds to following atom |
| Charge (suffix) | ^N± after atom | Ca^2+, Cl^- | IUPAC number-then-sign |
| Oxidation state | ^(Roman) | Fe^(II), Mn^(VII) | Roman numerals in parens |
^14C^131I^238UCa^2+Cl^-SO_4^2-Fe^(II)Fe^(III)| Bracket | Syntax | Example |
|---|---|---|
| Parentheses | (...) | Ca(OH)_2 |
| Square brackets | [...] | [Fe(CN)_6]^4- |
| Braces | {...} | {NH_4}_2SO_4 |
Bracket kind is preserved through round-trip — () stays (),
[] stays [].
Ca(OH)_2(NH_4)_2SO_4[Fe(CN)_6]^4-asciichem gem to see this rendered.
[Co(NH_3)_6]^3+asciichem gem to see this rendered.
| Kind | Syntax | Example | CML order |
|---|---|---|---|
| Single | - | H-O-H | S |
| Double | = | H_2C=CH_2 | D |
| Triple | # | HC#CH | T |
| Quadruple | ## | Re##Re | Q |
| Wedge (toward viewer) | >- | C>-H | W |
| Hash (away from viewer) | -< | C-<H | H |
| Dative / coordinate | ~> | NH_3~>BF_3 | DG |
| Wavy / resonance | ~~ | A~~B | V |
H-O-HH_2C=CH_2HC#CHRe##ReC>-HC-<HNH_3~>BF_3A~~B| Construct | Syntax | Example |
|---|---|---|
| R/S configuration | (R)-, (S)- | (R)-CH_3, (S)-CH(OH)COOH |
| E/Z geometry | (E)-, (Z)- | (E)-CH=CH, (Z)-A=B |
| Greek alpha/beta | (alpha)-, (beta)- | (alpha)-C, (beta)-C |
| Greek Unicode | (α)-, (β)- | (α)-C |
AsciiMath-style typed words (alpha, beta) are accepted alongside
the Unicode symbols.
(R)-CH_3(S)-CH(OH)COOH(E)-CH=CH(Z)-A=B(alpha)-C(beta)-C| Construct | Syntax | Example | Meaning |
|---|---|---|---|
| Lone pair prefix | : or :: | :O, ::O | 1 or 2 lone pairs |
| Radical suffix | . | Cl., O=O.. | Unpaired electron(s) |
:O::OCl.O=O..| Arrow | Syntax | Kind | Example |
|---|---|---|---|
| Forward | -> | :forward | 2H_2 + O_2 -> 2H_2O |
| Reverse | <- | :reverse | A <- B |
| Equilibrium | <=> | :equilibrium | N_2 + 3H_2 <=> 2NH_3 |
| Resonance | <-> | :resonance | A <-> B |
Conditions sit in bracketed groups immediately after the arrow. The
first [...] is the above condition (catalyst); the second is
the below condition (temperature, pressure).
N_2 + 3H_2 <=>[Fe][400C] 2NH_3A <=>[H_2O] BA -> B -> C2A -> 2B -> 2CA <=>[Fe][T] B -> CMulti-step chains promote to a single ReactionCascade.
Two or more orbital^occupancy pairs:
1s^2 2s^21s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^10Ground state of zinc.
Backtick-delimited runs are parsed by Plurimath:
`K_c = [P]/[R]``x^2 + y^2``rate = k[A]^2[B]`Use embedded math for equilibrium constants, rate laws, and thermodynamic expressions that sit naturally inside chemistry.
Real chemistry mixes every construct:
^14C_6H_12O_6 + 6O_2 -> 6CO_2 + 6H_2O `Delta G = -2870 kJ/mol`A radioactive glucose combustion with embedded thermodynamics.
| Construct | Input | Output | Rule |
|---|---|---|---|
| Charge | Ca^+2 | Ca^2+ | IUPAC number-then-sign |
| Everything else | — | unchanged | The formatter only normalises marker spellings |
Writing a formula
Elements + subscripts: H_2SO_4, C_6H_12O_6
Writing an ion
Element + charge: Na^+, SO_4^2-
Writing an isotope
Prefix isotope: ^14C, ^131I
Writing a reaction
Reactants -> products: 2H_2 + O_2 -> 2H_2O
Writing equilibrium
Use <=> with conditions: N_2 + 3H_2 <=>[Fe][400C] 2NH_3
Writing a bond
Between atoms: H-O-H, HC#CH, H_2C=CH_2
Writing a group
Parenthesised: Ca(OH)_2, (NH_4)_2SO_4
Writing math
Backtick-wrapped: `K_a = [H+][A-]/[HA]`