AbstractTwo-dimensional electron gases (2DEG), arising due to quantum confinement at interfaces between transparent conducting oxides, have received tremendous attention in view of electronic applications. Here, we explore the potential of interfaces formed by two lattice-matched wide-gap oxides of emerging interest, i.e., the polar, orthorhombic perovskite LaInO3 and the nonpolar, cubic perovskite BaSnO3, employing first-principles approaches. We find that the polar discontinuity at the interface is mainly compensated by electronic relaxation through charge transfer from the LaInO3 to the BaSnO3 side. This leads to the formation of a 2DEG hosted by the highly dispersive Sn-s-derived conduction band and a 2D hole gas of O-p character, strongly localized inside LaInO3. We rationalize how polar distortions, termination, thickness, and dimensionality of the system (periodic or non-periodic) can be exploited in view of tailoring the 2DEG characteristics, and why this material is superior to the most studied prototype LaAlO3/SrTiO3.