We use hybrid density functional calculations to assess n-type doping in monoclinic (AlxGa1−x)2O3 alloys. We focus on silicon, the most promising donor dopant, and study the structural properties, formation energies and charge-state transition levels of its various configurations. We also explore the impact of carbon and hydrogen, which are common impurities in metal-organic chemical vapor deposition (MOCVD). In Ga2O3, SiGa is an effective shallow donor, but in Al2O3 Si Al acts as a DX center with a (+/−) transition level in the band gap. Interstitial hydrogen acts as a shallow donor in Ga2O3, but behaves as a compensating acceptor in n-type Al2O3. Interpolation indicates that Si is an effective donor in (AlxGa1−x)2O3 up to 70% Al, but it can be compensated by hydrogen already at 1% Al. We also assess the diffusivity of hydrogen and study complex formation. Sication-H complexes have relatively low binding energies. Substitutional carbon on a cation site acts as a shallow donor in Ga2O3, but can be stable in a negative charge state in (AlxGa1−x)2O3 when x>5%. Substitutional carbon on an oxygen site (CO) always acts as an acceptor in n-type (AlxGa1−x)2O3, but will incorporate only under relatively oxygen-poor conditions. CO-H complexes can actually incorporate more easily, explaining observations of carbon-related compensation in Ga2O3 grown by MOCVD. We also investigate Ccation-H complexes, finding they have high binding energies and act as compensating acceptors when x>56%; otherwise the hydrogen just passivates the unintentional carbon donors. C-H complex formation explains why MOCVD-grown Ga2O3 can exhibit record-low free-carrier concentrations, in spite of the unavoidable incorporation of carbon. Our study highlights that, while Si is in principle a suitable shallow donor in (AlxGa1−x)2O3 alloys up to high Al compositions, control of unintentional impurities is essential to avoid compensation.