Skip to content

About AsciiChem

ASCII in, chemistry out.

AsciiChem is a plain-keyboard language for chemistry. Anything a chemist can type without leaving the home row, AsciiChem parses into a semantic model and renders to any supported output.

AsciiChem is a portmanteau of Ascii (the character set) and Chem (chemistry). It follows the same naming pattern as AsciiMath — a plain-keyboard language for a domain that traditionally required typesetting.

The lowercase “A” in the logo wordmark nods to AsciiMath, the project that inspired this one. Where AsciiMath tackles mathematics typography, AsciiChem tackles chemistry semantics.

The AsciiChem logo is a stylised atom: a central nucleus with three elliptical orbits at 60-degree rotations.

Light mode
AsciiChem logo (light)
Dark mode
AsciiChem logo (dark)
  • Central nucleus — the semantic model at the heart of every parse.
  • Three orbits — the primary output formats (MathML, HTML, LaTeX, SVG), evenly rotated.
  • Green colour (#0c4a3e) — growth, biology, and the chemical industry’s sustainability pivot.

AsciiChem was created to close the gap that AsciiMath leaves open: chemistry is not math typography. Prefix isotopes (^14C), reactions with conditions (N_2 + 3H_2 <=>[Fe][400C] 2NH_3), electron configurations, and Lewis markers all have no clean AsciiMath spelling.

The project is the language itself — a specification of syntax and semantics. The current reference implementation is the asciichem-ruby gem; other implementations (TypeScript, Python) may follow.

AsciiChem’s mission is plain-keyboard chemistry: anything a chemist can type on a standard keyboard, AsciiChem should be able to parse into a semantic model and render to any supported output format.

Constraints that shape every design decision:

  1. Plain ASCII. No Unicode arrows, no LaTeX commands, no special characters that aren’t on a US keyboard.
  2. Model-driven. Every parse produces a typed tree. Render to any format without round-tripping through text.
  3. Round-trippable. parse(s).to_text == s for any canonical s.
  4. IUPAC-aligned. Where AsciiChem’s spelling differs from mhchem, the IUPAC Green Book is the tiebreaker.
  5. Open/closed. New constructs are new model classes; new outputs are new formatters. Existing code stays untouched.
ProjectDescription
asciichem-rubyReference implementation (Ruby)
asciichem.github.ioThis specification site
plurimathEmbedded math (AsciiChem wraps Plurimath for math expressions)
📚

Publications

Type chemistry formulae in Markdown, AsciiDoc, or plain text and render consistently across HTML, PDF, and print.

🎓

Education

Students learn chemistry with a syntax they can type on any keyboard — no LaTeX, no special software required.

⚙️

Tooling

Programmatic chemistry: parse, validate (via the linter), and render in build pipelines.

🔄

Migration

Convert existing mhchem content to a format that survives outside LaTeX. The LaTeX formatter emits \ce{...} for round-tripping.

AsciiChem is designed against:

  • IUPAC Green Book (3rd ed., 2007) — quantities, units, and symbols in physical chemistry.
  • IUPAC Recommendation 2018 — inorganic chemistry formula nomenclature.
  • LaTeX mhchem — formula-level syntax (we borrow and adapt).
  • LaTeX chemfig — structural-diagram concepts (deferred to v0.3+ via elk-rb integration).
  • CML (Chemical Markup Language) — XML round-trip is a target.

Where these sources disagree, the IUPAC Green Book wins. See IUPAC mapping for the full decision table.

AsciiChem is open source under the BSD-2-Clause license.

  • GitHub organisation: github.com/asciichem
  • Contributing: PRs welcome — read Getting started for the development workflow.
  • Issues: bug reports and feature requests on the respective GitHub issue trackers.
  1. Install a reference implementation: gem install asciichem
  2. Read the syntax tour: Syntax overview
  3. Try the examples: Common formulae
  4. Join the community: star the repos and open issues.

Open source project maintained by Ribose.