This article presents groomed jet substructure measurements in pp and Pb-Pb collisions at sNN=5.02 TeV with the ALICE detector. The soft drop grooming algorithm provides access to the hard parton splittings inside a jet by removing soft wide-angle radiation. We report the groomed jet momentum splitting fraction, zg, and the (scaled) groomed jet radius, θg. Charged-particle jets are reconstructed at midrapidity using the anti-kT algorithm with resolution parameters R=0.2 and R=0.4. In heavy-ion collisions, the large underlying event poses a challenge for the reconstruction of groomed jet observables, since fluctuations in the background can cause groomed parton splittings to be misidentified. By using strong grooming conditions to reduce this background, we report these observables fully corrected for detector effects and background fluctuations for the first time. A narrowing of the θg distribution in Pb-Pb collisions compared to pp collisions is seen, which provides direct evidence of the modification of the angular structure of jets in the quark-gluon plasma. No significant modification of the zg distribution in Pb-Pb collisions compared to pp collisions is observed. These results are compared with a variety of theoretical models of jet quenching, and provide constraints on jet energy-loss mechanisms and coherence effects in the quark-gluon plasma.