Over the past two decades, extensive research has been carried out in the field of structural health monitoring for damage detection in structural systems. Some crack detection methods are based on the finite element model of a beam and use vibration data are developed. These methods identify the crack by updating of the finite element model according to the vibration data of structure. This paper proposes a novel method for crack detection in Euler–Bernoulli beams based on the closed-form solution of mode shapes using Bayesian inference. The expression of vibration modes is derived analytically with the crack parameters as unknown variables. Subsequently, the Bayesian inference is used to obtain the probability density function of crack parameters and to evaluate the uncertainty of the modes. Finally, the method is applied to a series of numerical examples, including a beam with a single-crack and multi-cracks, to verify the effectiveness of this method.