Sometimes a molecular formula is written using groups, for instance $\ce{Al2(SO4)3}$.

Are there examples of formulas with nested groups, such as $\ce{ABC[MNO2(XYZ)4]3}$ or is this avoided?

  • 1
    $\begingroup$ Very good question. My first thought was organometallic complexes or products of incongruent weathering of igneous and metamorphic minerals but I've not been able to find an example. Maybe the organic realm? $\endgroup$ Nov 22, 2021 at 14:30
  • 3
    $\begingroup$ I'm not quite 100% sure if this is what the OP want but there's Na[HFe(CO)4] on en.wikipedia.org/wiki/Metal_carbonyl_hydride - Pull off the second proton from the carbonyl hydride and you are there, but it might qualify as is $\endgroup$
    – Ian Bush
    Nov 22, 2021 at 22:38
  • $\begingroup$ @IanBush On that same page there is HCo(CO)3(P(OPh)3) that could qualify? Or are nested groups written with square brackets for the outer group and parentheses for the inner one? $\endgroup$
    – xenoid
    Nov 22, 2021 at 22:44
  • 1
    $\begingroup$ @xenoid You wrote the question, you judge what qualifies ... $\endgroup$
    – Ian Bush
    Nov 22, 2021 at 22:45
  • $\begingroup$ @IanBush I'm not a chemist, just trying to figure out how formulas could look like for a program that will process them. $\endgroup$
    – xenoid
    Nov 22, 2021 at 23:01

2 Answers 2


Too long for a comment: Chemical formulas for polymers can utilize nested enclosing glyphs but, from what I've seen, the accepted format is to use parentheses for the inner glyphs, and square brackets for the outer glyphs, rather than nested parentheses.

An example would be polystyrene, whose monomers look like this (source: Wikipedia: Polystyrene):

enter image description here

Given this, the formula for polystyrene could be given as:

$$\ce{CH3–(C8H8)_{n}\! -CH3}$$

But some might prefer to instead give it, more informatively, as the following, in which case the nested enclosing glphys make an appearance:

$$\ce{CH3–[CH2-CH(C6H5)]_n –CH3}$$

[See William Reusch's polymers website (MSU), Section 2. Writing Formulas for Polymeric Macromolecules , which provides many such examples.]

Using parentheses inside square brackets is also the convention given here for complex ions: Wikipedia: Chemical formula

Since you're trying to write a program, you might find something here to be of use:

Stack Overflow: Can nested parentheticals be parsed in chemical formulae?


The closest I could find is mixed cation-anion salt:

  1. $\ce{NaM2[PuO4(OH)2]·4H2O}$ where $\ce{M = Rb,Cs}$ and $\ce{NaRb5[PuO4(OH)2]2·6H2O}$.
  2. $\ce{(NO)_{0.25}(NO2)_{0.75}Cu(SbF6)3}$, $\ce{(H3O)_{0.125}(NO)_{0.125}(NO2)_{0.75}Zn(SbF6)3}$, $\ce{(H3O)_{0.25}(NO2)_{0.75}M(SbF6)3}$ where $\ce{(M=Cu, Zn)}$

Also make sure to check double salts and this question.


  1. Grigor’ev, M.S., Krot, N.N. & Charushnikova, I.A. Synthesis and Structure of Mixed-Cation Salts with [PuO4(OH)2]3– Anions. Radiochemistry 60, 233–240 (2018). DOI: 10.1134/S1066362218030025
  2. Z. Mazej, E. Goreshnik, Eur. J. Inorg. Chem. 2021, 1776. DOI: 10.1002/ejic.202100139

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.