The burden of mental illness in young people with chronic liver disease is not known. In this population cohort study in England, we identified 358 individuals (aged ≤25 years) diagnosed with autoimmune hepatitis or liver disease related to cystic fibrosis and 1541 propensity-score-matched controls. By the first year of follow-up, the cumulative burden of psychiatric events in participants with liver disease was high compared with controls: anxiety disorder (6.87 per 100 individuals [95% CI 4.00–9.73] v. 2.22 [95% CI 1.37–3.07]), depression (5.10 [95% CI 2.83–7.37] v. 0.86 [95% CI 0.53–1.19]), substance misuse (10.61 [95% CI 9.50–11.73] v. 1.23 [95% CI 0.71–1.75]) and self-harm (3.09 [95% CI 1.12–5.05] v. 0.20 [95% CI 0.07–0.33]). Participants with liver disease had a 2-fold increase (OR = 1.94, 95% CI 1.45–2.58), a 2.5-fold increase (OR = 2.59, 95% CI 1.91–3.50) and 4.4-fold increase (OR = 4.44; 95% CI 3.46–5.71) in the risk of anxiety, depression and substance misuse, respectively. These findings highlight the need for effective intervention in psychiatric disorders in young people with rare liver disease.