Skip to content

Common formulae

Every block on this page is rendered at build time by invoking the asciichem gem. Source on the left; MathML output on the right. If you view the page source, you’ll see the same is what you’d type.

H_2O
H 2 O
CO_2
C O 2
NaCl
Na Cl
CH_4
C H 4
HCl
H Cl
H_2SO_4
H 2 S O 4
HNO_3
H N O 3
H_3PO_4
H 3 P O 4
NaOH
Na O H
Ca(OH)_2
Ca ( O H ) 2
Na^+
Na +
Cl^-
Cl -
SO_4^2-
S O 4 2 -
NO_3^-
N O 3 -
Ca^2+
Ca 2 +
^14C
C 14
^131I
I 131
^238U
U 238
^3H
H 3

The prefix isotope binds to the atom. See Atoms for the full story.

[Fe(CN)_6]^4-
[ Fe ( C N ) 6 ] ^4-
[Co(NH_3)_6]^3+
Install the asciichem gem to see this rendered.
[PtCl_4]^2-
[ Pt Cl 4 ] ^2-
2H_2O
2 H 2 O
3H_2
3 H 2
C_6H_12O_6
C 6 H 12 O 6
2H_2 + O_2 -> 2H_2O
2 H 2 + O 2 2 H 2 O
N_2 + 3H_2 <=>[Fe][400°C] 2NH_3
N 2 + 3 H 2 Fe 400°C 2 N H 3
CH_4 + 2O_2 -> CO_2 + 2H_2O
C H 4 + 2 O 2 C O 2 + 2 H 2 O
H-O-H
H - O - H
H_2C=CH_2
H 2 C = C H 2
HC#CH
H C C H
1s^2 2s^2 2p^6
1s^2 2s^2 2p^6
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
Terminal window
gem install asciichem
asciichem convert -i "2H_2 + O_2 -> 2H_2O" -t mathml
asciichem convert -i "2H_2 + O_2 -> 2H_2O" -t latex
asciichem roundtrip -i "2H_2 + O_2 -> 2H_2O"