Bile acids are abundant in the mammalian gut where they undergo bacteria-mediated transformation, generating a large pool of bioactive molecules. Although bile acids are known to affect host metabolism, cancer progression and innate immunity, it is unknown whether they affect adaptive immune cells such as T helper cells expressing IL-17a (Th17 cells) and regulatory T cells (Tregs). By screening a library of bile acid metabolites, we identified two distinct derivatives of lithocholic acid (LCA), 3-oxoLCA and isoalloLCA, as T cell regulators. 3-oxoLCA inhibited Th17 cell differentiation by directly binding to its key transcription factor RORγt (retinoid-related orphan receptor γt) and isoalloLCA enhanced Treg differentiation through the production of mitochondrial reactive oxygen species (mitoROS), leading to increased FoxP3 expression. IsoalloLCA-mediated Treg enhancement required an intronic FoxP3 enhancer, the conserved noncoding sequence 3 (CNS3), a distinct mode of action from previously-identified Treg enhancing metabolites that require CNS1. Administration of 3-oxoLCA and isoalloLCA to mice reduced Th17 and increased Treg cell differentiation in the intestinal lamina propria. Our data suggest novel mechanisms by which bile acid metabolites control host immune responses by directly modulating the Th17 and Treg balance.