Efficient adsorbents for excess bilirubin removal are extremely important for the treatment of hyperbilirubinemia. However, traditional adsorbents, such as activated carbons and ion-exchange resins, still suffer from dissatisfactory adsorption performance and poor blood compatibility. Herein, we adopted a rational design strategy guided by density functional theory (DFT) calculations to prepare blood-compatible quaternary ammonium group grafted electrospun polyacrylonitrile nanofiber adsorbents. The calculation analysis and adsorption experiments were used to investigate the structure–function relationship between group types and bilirubin adsorption, both indicating that quaternary ammonium groups with suitable configurations played a crucial role in bilirubin binding. The obtained nanofiber adsorbents showed the bilirubin removal efficiency above 90% even at a coexisting BSA concentration of 50 g L−1. The maximum adsorption capacities were 818.9 mg g−1 in free bilirubin solution and 163.7 mg g−1 in albumin bound bilirubin solution. The nanofiber adsorbents also showed considerable bilirubin removal in dynamic adsorption to reduce the bilirubin concentration to a normal level, which was better than commercial activated carbons. Our study demonstrates the high feasibility of a theory-driven design method for the development of grafted electrospun nanofibers, which have good potential as bilirubin adsorbents in hemoperfusion applications.