Previous studies found that sodium alginate (SA) was protective against several liver diseases. However, the effect of SA on drug-induced liver injury is not clear. This study investigated the effect and mechanism of SA on isoniazid (INH)-induced liver injury in mice. Twenty-one male BALB/c mice were randomly divided into three groups: the control (AIN-93 M diet), the INH (AIN-93 M diet with 0.66 g INH/kg diet) and the SA group (AIN-93 M diet with 0.66 g INH/kg diet and 0.8 g SA/kg diet). After 10 weeks, the liver function indices, histopathological changes, fecal metabolites, and gut microbiota compositions were measured. Compared with the INH group, the SA group had significantly reduced alanine aminotransferase (ALT) and histopathological liver injury. Also, the SA treatment significantly reduced the content of several fecal metabolites including the indole, phenylalanine, and tyrosine derivatives. In addition, the SA treatment significantly increased the content of seven gut bacteria including Dorea, Eubacterium xylanophilum group, and Papillibacter and reduced the content of 11 gut bacteria including Alloprevotella. The changes in fecal metabolites and gut bacteria were associated with those in serum ALT and histopathological liver injury. In conclusion, SA alleviated INH-induced liver injury in mice by modulating fecal metabolites and gut bacteria.