Skip to content

Syntax cheat sheet

A single-page reference for every construct AsciiChem can encode. Print it, bookmark it, or scan it before writing chemistry.

ConstructSyntaxExampleNotes
Element symbolCapital + optional lowercaseH, He, FeOne or two letters
Subscript (multiplicity)_N after atomH_2, H_2OBinds to preceding atom
Multi-char subscript_{...}H_{2a}Braces for non-numeric
Stoichiometric coefficientLeading digits2H_2O, 3H_2Distinct from subscript
Source Rendered
H He H_2 H_2O C_6H_12O_6 2H_2O
H He H 2 H 2 O C 6 H 12 O 6 2 H 2 O
ConstructSyntaxExampleNotes
Prefix isotope^N before atom^14C, ^238UBinds to following atom
Charge (suffix)^N± after atomCa^2+, Cl^-IUPAC number-then-sign
Oxidation state^(Roman)Fe^(II), Mn^(VII)Roman numerals in parens
Source Rendered
^14C ^131I ^238U Ca^2+ Cl^- SO_4^2- Fe^(II) Fe^(III)
C 14 I 131 U 238 Ca 2 + Cl - S O 4 2 - Fe II Fe III
BracketSyntaxExample
Parentheses(...)Ca(OH)_2
Square brackets[...][Fe(CN)_6]
Braces{...}{NH_4}_2SO_4

Bracket kind is preserved through round-trip — () stays (), [] stays [].

Source Rendered
Ca(OH)_2 (NH_4)_2SO_4 [Fe(CN)_6] [Fe(CN)_6]_3
Ca ( O H ) 2 ( N H 4 ) 2 S O 4 [ Fe ( C N ) 6 ] [ Fe ( C N ) 6 ] 3
KindSyntaxExampleCML order
Single-H-O-HS
Double=H_2C=CH_2D
Triple#HC#CHT
Quadruple##Re##ReQ
Wedge (toward viewer)>-C>-HW
Hash (away from viewer)-<C-<HH
Dative / coordinate~>NH_3~>BF_3DG
Wavy / resonance~~A~~BV
Source Rendered
H-O-H H_2C=CH_2 HC#CH Re##Re C>-H C-<H NH_3~>BF_3 A~~B
H - O - H H 2 C = C H 2 H C ≡ C H Re ≣ Re C ↑ H C ↓ H N H 3 → B F 3 A ∼ B
ConstructSyntaxExample
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.

Source Rendered
(R)-CH_3 (S)-CH(OH)COOH (E)-CH=CH (Z)-A=B (alpha)-C (beta)-C
(R)- C H 3 (S)- C H ( O H ) C O O H (E)- C H = C H (Z)- A = B (alpha)- C (beta)- C
ConstructSyntaxExampleMeaning
Lone pair prefix: or :::O, ::O1 or 2 lone pairs
Radical suffix.Cl., O=O..Unpaired electron(s)
Source Rendered
:O ::O Cl. O=O..
: O :: O Cl . O = O ..
ArrowSyntaxKindExample
Forward->:forward2H_2 + O_2 -> 2H_2O
Reverse<-:reverseA <- B
Equilibrium<=>:equilibriumN_2 + 3H_2 <=> 2NH_3
Resonance<->:resonanceA <-> 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).

Source Rendered
N_2 + 3H_2 <=>[Fe][400C] 2NH_3 A <=>[H_2O] B
N 2 + 3 H 2 ⇌ Fe 400 C 2 N H 3 A ⇌ H 2 O B
Source Rendered
A -> B -> C 2A -> 2B -> 2C A <=>[Fe][T] B -> C
A → B → C 2 A → 2 B → 2 C A ⇌ Fe T B → C

Multi-step chains promote to a single ReactionCascade.

Two or more orbital^occupancy pairs:

Source Rendered
1s^2 2s^2 1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^10
1s 2   2s 2   1s 2   2s 2   2p 6   3s 2   3p 6   4s 2   3d 10

Ground state of zinc.

Backtick-delimited runs are parsed by Plurimath:

Source Rendered
`K_c = [P]/[R]` `x^2 + y^2` `rate = k[A]^2[B]`
K c = P R x 2 + y 2 r a t e = 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:

Source Rendered
^14C_6H_12O_6 + 6O_2 -> 6CO_2 + 6H_2O `Delta G = -2870 kJ/mol`
C 14 6 H 12 O 6 + 6 O 2 → 6 C O 2 + 6 H 2 O Δ G = − 2870 k J m o l

A radioactive glucose combustion with embedded thermodynamics.

ConstructInputOutputRule
ChargeCa^+2Ca^2+IUPAC number-then-sign
Everything else—unchangedThe 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]`

Play