We prove a sharp quantitative version of the Faber--Krahn inequality for the short-time Fourier transform (STFT). To do so, we consider a deficit δ(f;Ω) which measures by how much the STFT of a function f∈L2(R) fails to be optimally concentrated on an arbitrary set Ω⊂R2 of positive, finite measure. We then show that an optimal power of the deficit δ(f;Ω) controls both the L2-distance of f to an appropriate class of Gaussians and the distance of Ω to a ball, through the Fraenkel asymmetry of Ω. Our proof is completely quantitative and hence all constants are explicit. We also establish suitable generalizations of this result in the higher-dimensional context.