Goodness of fit is a statistical measure that determines how well a set of observed data fits a theoretical probability distribution. It is used to evaluate how closely the observed data matches the expected data under a particular model or hypothesis.