Hybrid organic–inorganic materials doped with zwitterionic push–pull chromophores with high hyperpolarizability have been synthesized by a sol–gel procedure. A large chromophore concentration was reached by using N-(hydroxyethyl)carbazole as a physical spacer (preventing the dye aggregation). Spin-coated doped films were electrically poled and second harmonic generation measurements performed in situ. During the thermally assisted poling under a N2 atmosphere, only the carbazole molecules degraded. Second-harmonic generation measurements gave an estimation of the nonlinear coefficient, r33, of 38 pm V–1 at 1064 nm.