Nystatin is used to treat fungal infections of the inside of the mouth and lining of the stomach and intestines.