The invention relates to the automatic cleaning of ion sources inside mass spectrometers, especially the cleaning of ion sources where the ions are generated by matrix-assisted laser desorption (MALDI).