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.

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

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

Source Rendered
[Fe(CN)_6] [Fe(CN)_6]_3 [PtCl_4]
[ Fe ( C N ) 6 ] [ Fe ( C N ) 6 ] 3 [ Pt Cl 4 ]
Source Rendered
2H_2O 3H_2 C_6H_12O_6
2 H 2 O 3 H 2 C 6 H 12 O 6
Source Rendered
2H_2 + O_2 -> 2H_2O N_2 + 3H_2 <=>[Fe][400°C] 2NH_3 CH_4 + 2O_2 -> CO_2 + 2H_2O
2 H 2 + O 2 → 2 H 2 O N 2 + 3 H 2 ⇌ Fe 400°C 2 N H 3 C H 4 + 2 O 2 → C O 2 + 2 H 2 O
Source Rendered
H-O-H H_2C=CH_2 HC#CH
H - O - H H 2 C = C H 2 H C ≡ C H
Source Rendered
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   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"
Play