We use the moving mesh code arepo coupled to a time-dependent chemical network to investigate molecular gas in simulated spiral galaxies that is not traced by CO emission. We calculate H2 and CO column densities, and estimate the CO emission and CO–H2 conversion factor. We find that in conditions akin to those in the local interstellar medium, around 42 per cent of the total molecular mass should be in CO-dark regions, in reasonable agreement with observational estimates. This fraction is almost insensitive to the CO-integrated intensity threshold used to discriminate between CO-bright and CO-dark gas. The CO-dark molecular gas primarily resides in extremely long (>100 pc) filaments that are stretched between spiral arms by galactic shear. ...