We assessed the cost-effectiveness and cost-utility of therapeutic drug monitoring (TDM)-guided mercaptopurine treatment compared with placebo in ulcerative colitis (UC) patients failing 5-aminosalicylates. Data were gathered alongside the randomized controlled OPTIC trial (EudraCT: 2015-005260-41). The evaluation was performed from a health care and societal perspective as cost-effectiveness and cost-utility analyses with a time horizon of one year. Volumes and costs of in-hospital care, out-of-hospital care, out-of-pocket expenses and productivity loss were assessed. The main outcomes were the extra costs per additional patient who achieved clinical remission and endoscopic improvement at 52weeks (responders) and extra costs per quality-adjusted life-year (QALY) gained. In total, 59 patients were randomized to the intervention (n=29) and control (n=30) group. Non-significant differences in costs were €63 (-€1267 to €1434; P=0.93) in favour of placebo from a health care perspective and -€742 (-€3683 to €2016; P=0.64) in favour of mercaptopurine from a societal perspective. The higher proportion of responders and a non-significant QALY difference of 0.0475 (-0.024-0.117) (P=0.184) favouring patients on mercaptopurine treatment resulted in €165 extra costs per additional responder and €1326 extra costs per QALY gained from a health care perspective. From a societal perspective, dominance over placebo was observed with cost savings of €1937 per additional responder and €15,621 per QALY gained. The probability of optimised mercaptopurine treatment being cost-effective was 0.80 at a willingness to pay per additional QALY of €20,000. TDM-based mercaptopurine treatment in UC patients failing 5-aminosalicylates is a cost-effective strategy from a societal perspective.