The imidazole glycerophosphate dehydratase (IGPD) protein is a therapeutic target for herbicide discovery. It is also regarded as a possible target in Staphylococcus xylosus (S. xylosus) for solving mastitis in the dairy cow. The 3D structure of IGPD protein is essential for discovering novel inhibitors during high-throughput virtual screening. However, to date, the 3D structure of IGPD protein of S. xylosus has not been solved. In this study, a series of computational techniques including homology modeling, Ramachandran Plots, and Verify 3D were performed in order to construct an appropriate 3D model of IGPD protein of S. xylosus. Nine hits were identified from 2,500 compounds by docking studies. Then, these nine compounds were first tested in vitro in S. xylosus biofilm formation using crystal violet staining. One of the potential compounds, baicalin was shown to significantly inhibit S. xylosus biofilm formation. Finally, the baicalin was further evaluated, which showed better inhibition of biofilm formation capability in S. xylosus by scanning electron microscopy. Hence, we have predicted the structure of IGPD protein of S. xylosus using computational techniques. We further discovered the IGPD protein was targeted by baicalin compound which inhibited the biofilm formation in S. xylosus. Our findings here would provide implications for the further development of novel IGPD inhibitors for the treatment of dairy mastitis.