Second-harmonic generation (SHG) in polycrystalline and porous LiTaO3- and LiNbO3-xerogels is reported. The ferroelectric xerogels are synthesized via the sol–gel method and sintered at different temperatures of 700°C, 900°C, 1100°C and 1150°C, respectively for 48 h. The nano-structured materials (grain size of 250–1760 nm) are characterized by scanning electron microscopy, thermogravimetry, Xray diffraction and piezoresponse force microscopy. The ferroelectricity of the grains is determined with piezoresponse force microscopy measurements. While the SHG efficiency grows with increasing grain size, the SHG output energy increases with a higher grade of stoichiometry and increases quadratically. as a function of the input energy.