RNA promotes liquid-liquid phase separation (LLPS) to build membraneless compartments in cells. How distinct molecular compositions are established and maintained in these liquid compartments is unknown. Here, we report that secondary structure allows messenger RNAs (mRNAs) to self-associate and determines whether an mRNA is recruited to or excluded from liquid compartments. The polyQ-protein Whi3 induces conformational changes in RNA structure and generates distinct molecular fluctuations depending on the RNA sequence. These data support a model in which structure-based, RNA-RNA interactions promote assembly of distinct droplets and protein-driven, conformational dynamics of the RNA maintain this identity. Thus, the shape of RNA can promote the formation and coexistence of the diverse array of RNA-rich liquid compartments found in a single cell.