I will present a calculation of jet mass distributions for small-radius jets in proton-proton and heavy ion collisions using soft-collinear effective theory (SCET). A process-independent groomed jet mass function is defined which captures the soft-collinear radiation inside jets. The factorization expression simplifies significantly, allowing one to calculate jet mass distributions for jets in any hard process with the corresponding jet cross section. Additional contributions from initial and final state radiation as well as underlying events are discussed. With the medium-induced splitting functions calculated using SCET with Glauber gluon interactions, the medium correction to jet mass distributions is incorporated consistently within the resummation framework. We provide calculations of jet mass distributions for inclusive jets and jets recoiling against a prompt photon or a $Z$ boson, and we compare with Pythia simulations of pp collisions and currently available measurements in pp and AA collisions at the LHC. In the end I will discuss the calculation of a new, collinear-drop jet observable and its use for systematically probing the inner working of the quark gluon plasma.