smenjas / chemistry-explorer

A chemistry app built with vanilla JavaScript
https://smenjas.github.io/chemistry-explorer/
ISC License
1 stars 2 forks source link

Convert molecular formulas to empirical formulas #61

Open smenjas opened 1 year ago

smenjas commented 1 year ago

A molecular formula counts how many of each element are present in a molecule, whereas an empirical formula describes the ratios of elements to one another.

For example, the empirical formula for glucose in C6H12O6, and the empirical formula is CH2O.