We study the secondary structure of RNA determined by Watson-Crick pairing without pseudo-knots using Milnor invariants of links. We focus on the first non-trivial invariant, which can be interpreted in terms of the Heisenberg group as well as lattice paths, which we call the Heisenberg invariant.