We consider the Allen-Cahn equation on the one-dimensional torus, perturbed by a small spacetime white noise. The deterministic equation is a nonlinear PDE, which can be seen as a gradient flow with respect to a double-well energy. If a small noise is added, the typical picture of a metastable dynamics emerges: the system quickly reaches a local equilibrium in one of the two wells; this state endures for an exponentially long time, until a sufficiently large stochastic fluctuation enables the system to overcome the energetic barrier separating the two wells. This behavior produces a slowdown in the relaxation to the equilibrium measure, reflected e.g. by an exponentially small spectral gap. In this talk I will present a technique which provides a formula for the precise asymptotic behavior of the spectral gap, showing that the prefactor is given by a suitable Fredholm determinant. The formula shows that the gap behaves like twice the inverse of the metastable transition time from one well to the other.