Skip to content
AsciiC6hem

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, UueOne 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
H
He
He
H_2
H 2
H_2O
H 2 O
C_6H_12O_6
C 6 H 12 O 6
2H_2O
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
C 14
^131I
I 131
^238U
U 238
Ca^2+
Ca 2 +
Cl^-
Cl -
SO_4^2-
S O 4 2 -
Fe^(II)
Fe II
Fe^(III)
Fe III
BracketSyntaxExample
Parentheses(...)Ca(OH)_2
Square brackets[...][Fe(CN)_6]^4-
Braces{...}{NH_4}_2SO_4

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

Source Rendered
Ca(OH)_2
Ca ( O H ) 2
(NH_4)_2SO_4
( N H 4 ) 2 S O 4
[Fe(CN)_6]^4-
Install the asciichem gem to see this rendered.
[Co(NH_3)_6]^3+
Install the asciichem gem to see this rendered.
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 - O - H
H_2C=CH_2
H 2 C = C H 2
HC#CH
H C C H
Re##Re
Re Re
C>-H
C H
C-<H
C H
NH_3~>BF_3
N H 3 B F 3
A~~B
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
(R)- C H 3
(S)-CH(OH)COOH
(S)- C H ( O H ) C O O H
(E)-CH=CH
(E)- C H = C H
(Z)-A=B
(Z)- A = B
(alpha)-C
(alpha)- C
(beta)-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
::O
:: O
Cl.
Cl .
O=O..
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
N 2 + 3 H 2 Fe 400 C 2 N H 3
A <=>[H_2O] B
A H 2 O B
Source Rendered
A -> B -> C
A B C
2A -> 2B -> 2C
2 A 2 B 2 C
A <=>[Fe][T] B -> 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 &#xA0; 2s 2
1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^10
1s 2 &#xA0; 2s 2 &#xA0; 2p 6 &#xA0; 3s 2 &#xA0; 3p 6 &#xA0; 4s 2 &#xA0; 3d 10

Ground state of zinc.

Backtick-delimited runs are parsed by Plurimath:

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