Survival analysis includes a wide variety of methods for analyzing time‐to‐event data. One basic but important goal in survival analysis is the comparison of survival curves between groups. Several nonparametric methods have been proposed in the literature to test for the equality of survival curves for censored data. When the null hypothesis of equality of curves is rejected, leading to the clear conclusion that at least one curve is different, it can be interesting to ascertain whether curves can be grouped or if all these curves are different from each other. A method is proposed that allows determining groups with an automatic selection of their number. The validity and behavior of the proposed method was evaluated through simulation studies. The applicability of the proposed method is illustrated using real data. Software in the form of an R package has been developed implementing the proposed method.