A measurement of the branching fraction of the decay B 0 s → K 0 S K 0 S is performed using proton–proton collision data corresponding to an integrated luminosity of 5 fb − 1 collected by the LHCb experiment between 2011 and 2016. The branching fraction is determined to be B ( B 0 s → K 0 S K 0 S ) = [ 8.3 ± 1.6 ( stat ) ± 0.9 ( syst ) ± 0.8 ( norm ) ± 0.3 ( f s / f d ) ] × 10 − 6 , where the first uncertainty is statistical, the second is systematic, and the third and fourth are due to uncertainties on the branching fraction of the normalization mode B 0 → ϕ K 0 S and the ratio of hadronization fractions f s / f d . This is the most precise measurement of this branching fraction to date. Furthermore, a measurement of the branching fraction of the decay B 0 → K 0 S K 0 S is performed relative to that of the B 0 s → K 0 S K 0 S channel, and is found to be B ( B 0 → K 0 S K 0 S ) B ( B 0 s → K 0 S K 0 S ) = [ 7.5 ± 3.1 ( stat ) ± 0.5 ( syst ) ± 0.3 ( f s / f d ) ] × 10 − 2 .