We consider the Ramsauer–Townsend effect in the presence of a generalized uncertainty principle (GUP) and within the Dirac equation framework for potential well, step potential and infinite well. The system characteristics are obtained in an exact analytical manner and the effect of minimal length parameter on the spectrum of the system is well-illustrated.