This study elucidates CD2, CD8A, GNLY, IFI44, NKG7 and OAS2 as the core genes of UC and NASH. Here, CD2 is linked to metabolic dysfunction-associated steatohepatitis.