Understanding the motion of magnetic skyrmions is essential if they are to be used as information carriers in devices. It is now shown that topological confinement endows the skyrmions with an unexpectedly large mass, which plays a key role in their dynamics. Skyrmions are topologically protected winding vector fields characterized by a spherical topology1. Magnetic skyrmions can arise as the result of the interplay of various interactions, including exchange, dipolar and anisotropy energy in the case of magnetic bubbles2,3,4 and an additional Dzyaloshinskii–Moriya interaction in the case of chiral skyrmions5. Whereas the static and low-frequency dynamics of skyrmions are already well under control6,7,8,9, their gigahertz dynamical behaviour2 has not been directly observed in real space. Here, we image the gigahertz gyrotropic eigenmode dynamics of a single magnetic bubble and use its trajectory to experimentally confirm its skyrmion topology. The particular trajectory points to the presence of strong inertia, with a mass much larger than predicted by existing theories. This mass is endowed by the topological confinement of the skyrmion and the energy associated with its size change. It is thereby expected to be found in all skyrmionic structures in magnetic systems and beyond. Our experiments demonstrate that the mass term plays a key role in describing skyrmion dynamics.