ClassNoise is an R package for modeling, generating, and validating data affected by class noise. It provides an environment where the type of noise, its magnitude, and the resulting noisy samples are precisely known. Drawing inspiration from probabilistic modeling, ClassNoise adopts Bayesian Networks to simplify the description of noise models through conditional independence. A workflow for designing noise models, exploiting machine learning techniques and expert knowledge, is proposed. Although, conceived as a tool for researching the impact of class noise on supervised machine learning, ClassNoise can be useful in any field where the effects of noise need to be established.