Reservoir properties of Upper Triassic–Middle Jurassic sandstones, Spitsbergen, are studied as part of a CO2 storage pilot project in Longyearbyen. The reservoir formations show large contrasts in sandstone compositions, with unexpected low permeability despite moderate porosity values. Petrographic analyses were performed to investigate the influence and distribution of diagenesis. It is concluded that, because of various compaction, cementation, and dissolution processes, the sandstone porosity is mainly isolated molds and micropores and associated with fibrous illite and chamosite, explaining the low permeability. Diagenesis and the distribution of quartz cement is influenced by lithofacies and detrital compositions. Mineralogically immature sandstones (De Geerdalen Formation) show a homogeneous distribution of quartz cement overgrowths on quartz grains, distributed interstitial to labile grains and other cements (e.g., late calcite). The main silica source was from the dissolution of adjacent feldspar and labile grains as part of the chemical compaction. In contrast, quartz-dominated sandstones (Knorringfjellet Formation) show a heterogeneous patchy distribution of quartz cement influenced by the sedimentary bioturbation pattern, with silica sourced also from dissolution at clay-rich microstylolites. Phosphatic beds at the base and top of the formation are strongly influenced by marine eogenesis and reworking processes and associated with concentration of iron-rich authigenic minerals. The highest porosity appears in sand-supported conglomerate where moldic clay-mineral ooids contributed to reduce quartz cementation. The stratigraphic change from mineralogical immature (Triassic) to mature (uppermost Triassic–Jurassic) sandstone compositions is detected in wide areas of the Barents Shelf and has considerable implications for the distribution of sandstone reservoir properties.