The effective neutron and proton root-mean-square radius of stable and unstable nuclei (12–15,17B, 12–20C, 14–21N, 16–24O and 18–21,23–26F) were deduced from the charge-changing cross section, \(\sigma _{\text{cc}}\), and the interaction cross sections, \(\sigma _{\text{I}}\), by using a statistical abrasion–ablation model calculation. The extracted proton radii are in good agreement with the data from the Atomic Data and Nuclear Data Tables within the errors. Furthermore, we can observe that the neutron skin thickness increases monotonously with the increasing neutron number in these isotopes, which is consistent with the systematical trend of theoretical calculations.