Molecular simulations in nanochannels are used to explore the compression elasticity of ring polymers of stiffness (persistence length) similar to DNA. By combination with the parallel data for linear polymers, the effect of chain topology on their compression behavior is assessed. The results show that the ring polymers are much less bendable at longitudinal compression than the linear analogs. The chain span of linear polymers is continuously reduced at compression, whereas in ring polymers, an abrupt decrease of the span is observed. The simulation data elucidate this phenomenon as the buckling of a ring polymer into the double-folded hairpin. The shrinking ratio of sizes of the ring and linear chains shows a complex behavior much differing from the existing reports. The force–displacement functions for chains of both topologies at moderate confinement are very well accounted for by the mean-field Flory scheme. The theory predicts the difference in the mechanical stiffness of the ring and linear polymers in qualitative agreement with the simulation data. These findings are relevant to the compression behavior of semiflexible ring polymers under spatial constraints such as in nanofluidic experiments, disordered media, or cellular environment.