This paper shows the nonlinear stochastic Feynman–Kac formula holds under quadratic growth. For this, we initiate the study of backward doubly stochastic differential equations (BDSDEs, for short) with quadratic growth. The existence, uniqueness, and comparison theorem for one-dimensional BDSDEs are proved when the generator f(t,Y,Z) grows in Z quadratically and the terminal value is bounded, by introducing innovative approaches. Furthermore, in this framework, we utilize BDSDEs to provide a probabilistic representation of solutions to semilinear stochastic partial differential equations (SPDEs, for short) in Sobolev spaces, and use it to prove the existence and uniqueness of such SPDEs, thereby extending the nonlinear stochastic Feynman–Kac formula for linear growth introduced by Pardoux and Peng (1994).