Skip to content

Syntax overview

AsciiChem is plain ASCII chemistry. Every construct is something a chemist can type on a standard keyboard. This page is the tour: every construct, one example each, links to the detail pages.

H
H
He
He
C
C
Fe
Fe
Uue
Uu e

Atom reference →

H_2
H 2
H_2O
H 2 O
H_2SO_4
H 2 S O 4
C_6H_12O_6
C 6 H 12 O 6

Multi-character subscripts use braces: H_{2a}.

^14C
C 14
^131I
I 131
^238U
U 238

The prefix binds to the following atom. Why this matters →

Ca^2+
Ca 2 +
Cl^-
Cl -
SO_4^2-
S O 4 2 -
Fe^3+
Fe 3 +

IUPAC canonical form: number-then-sign. +2 is normalised to 2+.

Fe^(II)
Fe II
Fe^(III)
Fe III
Mn^(VII)
Mn VII

Roman numerals in parens.

2H_2O
2 H 2 O
3H_2
3 H 2
10CO_2
10 C O 2

Leading digits followed by an element or open bracket.

Ca(OH)_2
Ca ( O H ) 2
(NH_4)_2SO_4
( N H 4 ) 2 S O 4
[Fe(CN)_6]^4-
[ Fe ( C N ) 6 ] ^4-

Bracket variants (), [], {} are preserved through round-trip.

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

Eight kinds: single, double, triple, quadruple, wedge, hash, dative, wavy. Bond reference →

(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
(β)-C
(beta)- C

Markers attach to molecules. Greek alpha/beta typed words are accepted alongside α/β. Stereo reference →

:O
: O
::O
:: O
Cl.
Cl .
O=O..
O = O ..

Prefix : for lone pairs; suffix . for radical electrons.

2H_2 + O_2 -> 2H_2O
2 H 2 + O 2 2 H 2 O
HCl + NaOH -> NaCl + H_2O
H Cl + Na O H Na Cl + H 2 O
N_2 + 3H_2 <=>[Fe][400°C] 2NH_3
N 2 + 3 H 2 Fe 400°C 2 N H 3

Four arrow kinds: forward ->, reverse <-, equilibrium <=>, resonance <->. Conditions in [above][below] brackets. Reaction reference →

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. Cascade reference →

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

Two or more orbital^occupancy pairs.

`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 ]

Backtick-delimited runs are parsed by Plurimath. Embedded math reference →

Real chemistry mixes everything:

^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.

Per-construct detail

Each syntax page has worked examples and round-trip behaviour. Start with Atoms.

The model

Every construct maps to a model class. See The model for the layer diagram and per-class reference.

IUPAC mapping

Every construct’s spelling traced to its IUPAC source. See IUPAC mapping.