Carbon-bearing compounds display intriguing structural diversity, due to variations in hybrid bonding of carbon. Here, first-principles calculations and unbiased structure searches on yttrium dicarbide at pressure reveal four new structures with varying carbon polymerisation, in addition to the experimentally observed high-temperature low-pressure I4/mmm dimer phase. At low pressures, a metallic C2/m phase (four-member single-chain carbide) is stable, which transforms into a Pnma phase (single-chain carbide) upon increasing pressure, with further transformation to an Immm structure (double-chain carbide) at 54 GPa and then to a P6/mmm phase (sheet carbide) at 267 GPa. Yttrium dicarbide is structurally diverse, with carbon bonded as dimers (at lowest pressure), four-member single chains, infinite single chains, double chains and eventually sheet structures on compression. Electron-phonon coupling calculations indicate that the high-pressure phases are superconducting. Our results aid the understanding and design of new superconductors and illuminate pressure-induced carbon polymerisation in carbides.