During liver development, hepatocytes and biliary cells differentiate from common progenitors called hepatoblasts. The factors that control hepatoblast fate decision are unknown. Here we report that a gradient of activin/ TGF beta signaling controls hepatoblast differentiation. High activin/TGF beta signaling is required near the portal vein for differentiation of biliary cells. The Onecut transcription factors HNF-6 and OC-2 inhibit activin/TGF beta signaling in the parenchyma, and this allows normal hepatocyte differentiation. In the absence of Onecut factors, the shape of the activin/TGF beta gradient is perturbed and the hepatoblasts differentiate into hybrid cells that display characteristics of both hepatocytes and biliary cells. Thus, a gradient of activin/TGF beta signaling modulated by Onecut factors is required to segregate the hepatocytic and the biliary lineages.