First-principles calculations are performed to explore the possibility of generating the two-dimensional electron gas (2DEG) at the interface between LaGaO 3 /KTaO 3 and NdGaO 3 /KTaO 3 (001) heterostructures. Two different modelsi.e., the superlattice model and the thin film model -are used to conduct a comprehensive investigation of the origin of charge carriers. For the symmetric superlattice model, the LaGaO 3 (or NdGaO 3 ) film is nonpolar. The 2DEG with carrier density on the order of 10 14 cm −2 originates from the Ta d xy electrons contributed by both LaGaO 3 (or NdGaO 3 ) and KTaO 3 . For the thin film model, large polar distortions occur in the LaGaO 3 and NdGaO 3 layer, which entirely screens the built-in electric field and prevents electrons from transferring to the interface. Electrons of KTaO 3 are accumulated at the interface, contributing to the formation of the 2DEG. All the heterostructures exhibit conducting properties regardless of the film thickness. Compared with the Ti d xy electrons in SrTiO 3 -based heterostructures, the Ta d xy electrons have small effective mass and they are expected to move with higher mobility along the interface. These findings reveal the promising applications of 2DEG in novel nanoelectronic devices.