A new class of superfluids and superconductors with spatially periodic modulation of the superfluid density is arising1–12. It might be related to the supersolid phase of matter, in which the spontaneous breaking of gauge and translational symmetries leads to a spatially modulated macroscopic wavefunction13–16. This relation was recognized only in some cases1,2,5–9 and there is the need for a universal property quantifying the differences between supersolids and ordinary matter, such as the superfluid fraction, which measures the reduction in superfluid stiffness resulting from the spatial modulation16–18. The superfluid fraction was introduced long ago16, but it has not yet been assessed experimentally. Here we demonstrate an innovative method to measure the superfluid fraction based on the Josephson effect, a ubiquitous phenomenon associated with the presence of a physical barrier between two superfluids or superconductors19, which might also be expected for supersolids20, owing to the spatial modulation. We demonstrate that individual cells of a supersolid can sustain Josephson oscillations and we show that, from the current–phase dynamics, we can derive directly the superfluid fraction. Our study of a cold-atom dipolar supersolid7 reveals a relatively large sub-unity superfluid fraction that makes realistic the study of previously unknown phenomena such as partially quantized vortices and supercurrents16–18. Our results open a new direction of research that may unify the description of all supersolid-like systems.